if I am in the initializer list of the constructor of a class which inherits from std::function<stuff> ?
is it:
std::function< void ( Type argument, AnotherType anotherArgument )>() ?
So if I wanted to use the non-default constructor for std::function< stuff > I would do something like the following right?
Subclass::
Subclass( std::function< void ( Type argument, AnotherType anotherArgument )> happen )
: std::function< void ( Type argument, AnotherType anotherArgument )>( happen )
{
// stuff that needs to be initialized for this class
}
void functionImplementation( Type first, AnotherType second )
{
// implementation of function
}
void (*functionPointer)( Type, AnotherType )
functionPointer = &functionImplementation;
Subclass action = new Subclass( functionPointer )
or I would use it like this with lambda:
Subclass
action =
new Subclass
(
[]
( Type firstArgument, AnotherType secondArgument)
-> void
{
//implementation of function
};
)
Does my constructor for Subclassneed to be changed in order to call the constructor for std::function< stuff > properly?