here is what I would like to do:
typedef std::function<void(const callback&)> callback;
(Ie: defining a std::function that can pass as first arg an object of same type as itself).
However this doesn't compile (callback is not know when parsing argument, even if compiler knows the size of the arg as it's a const ref)
Does anyone knows some kind of hack (perhaps with template?) less ugly than the one I'm using:
struct scallback;
typedef std::function<void(const scallback&)> callback;
struct scallback { callback value; };
It's "ugly" because I have to use arg.value and not arg directly..
NB: I have to use std::function and not C-Like pointer, preventing using void* and cast. Thanks
Bob