I'm working on a translation of some C# code to C++. Since it's the first time I work with C++ there are some things I don't understand. The structur ...
I'm working on a translation of some C# code to C++. Since it's the first time I work with C++ there are some things I don't understand. The structur ...
My issue is with how the move semantics is done in libc++'s implementation of std::function. I can't understand the logic behind the design choices th ...
Let's say you have a class taking callable in its constructor. and a free function Why is it that you can construct an instance of this class us ...
I've got an interesting puzzle that I can't seem to completely solve. The following code is a snipped for my own function implementation. When I try t ...
This query is mainly based on std::function<R(Args...) >::operator= and std::any::operator=. The documentation shows that they are always implem ...
When using std::function to call a non-static member-function, we can pass either the object pointer or the object reference as the first parameter: ...
I'm trying to create class that can save function pointer, arguments and return type. my class that saves function // Here i can't pass temlpate bec ...
Currently, I am removing Boost dependencies from a project. I have replaced boost::function and boost::ref with std::function and std::ref, respective ...
Following up my question c++ - How do implicit conversions work when using an intermediate type?, from which I understood the rule of 1 implicit conve ...
I want to use submit to construct a function, which can be used in other threads. And In order not to be blocked, submit will return std::future, whic ...
This question is going to be very much a duplicate, but I've read many of the examples on stack overflow and the common solution is not compiling for ...
Background I'm trying to pass a std::function object as a parameter to evaluate the sum of its returned value over a range. However, for some reaso ...
I'm having trouble figuring out the best way to deal with allocation and deallocation of std::function. Of course the underlying function is never go ...
I am experimenting with making pure Haskell-style I/O in C++. It's working correctly, but when I reorganize some definitions, I run into a std::bad_fu ...
I am trying to pass a std::function as a parameter. I am having a couple problems with the syntax. The code is simple. I want to save a function handl ...
As I googled std::function works slower than simple lambda function. Consider the following use case will there be std::function penalty when using s ...
I'm sorry if this is a very noobish question, but I'm confused on how you can specify std::function argument lists like this: But in an actual func ...
I want to write a callback - wrapper around std::function without operator bool, which will do nothing in operator() if wrapped std::function in empty ...
I want to make a simple logger which automatically runs a function and returns its value. The class is defined as: I want to pass the following sim ...
Consider the following class: template <class T> struct Test { Test() { if (!f) { f = []() { std::cout << "it wor ...