ofats / any_invocable Goto Github PK
View Code? Open in Web Editor NEWСonservative, move-only equivalent of std::function
License: MIT License
Сonservative, move-only equivalent of std::function
License: MIT License
Nice early preview,
What's the license?
I'm using your implementation now. It compiles now. I did apply the linked patch to silence pedantic warnings: uNetworking/uWebSockets@d13aac1
Not sure if this is an issue with the implementation or I did something wrong.
Trying to invoke const ofats::any_invocable<void()>
or const ofats::any_invocable<void() const>
results in compilation errors. The former because matching call operator could not be found, the latter is because any_invocable_impl::call
doesn't have a const
variant. Please see an example on godbolt: https://godbolt.org/z/Wczddnsoh
The const
qualifier comes from being a member of a class and being invoked in const function, like:
struct stuff
{
void call() const { f(); }
ofats::any_invocable<void()> f; // or `void() const`
}
The following fails to compile on macOS Clang but does compile on Linux (both GCC and Clang):
std::vector<ofats::any_invocable<void()>> v;
v.emplace_back([]() {
});
You can test with GitHub Actions on macos-latest. This code should compile, right?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.