Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Stroika::Foundation::Execution::Function< FUNCTION_SIGNATURE > Class Template Reference

#include <Function.h>

Public Member Functions

 Function ()=default
 
nonvirtual Characters::String ToString () const
 

Detailed Description

template<typename FUNCTION_SIGNATURE>
class Stroika::Foundation::Execution::Function< FUNCTION_SIGNATURE >

IDEA is be SAME AS std::function<> but allow for operator<, a usable operator== etc..., which is an unfortunate omission from the c++ standard.

This should be convertible to a normal std::function<>, and fairly if not totally interoperable.

Aliases
This template could have been called Callback<> - as that's principally what its used for. Callbacks you need to be able to create, and then later remove (by value) - and this class lets you create an object (callback/Function) - which can then be added to a Mapping (or Set) and then later removed by value.
Note
This was implemented using a shared_ptr<function<...>> instead of a directly aggregated function object until Stroika v2.1d8.
Comparisons: static_assert (totally_ordered<Function<...>);

Definition at line 59 of file Function.h.

Constructor & Destructor Documentation

◆ Function()

template<typename FUNCTION_SIGNATURE >
Stroika::Foundation::Execution::Function< FUNCTION_SIGNATURE >::Function ( )
default
Note
Implementation note: Reason for the not derived_from<> restriction on CTOR/1(CTOR_FUNC_SIG&&) is to prevent compiler from instantiating that constructor template for argument subclasses of this Function type, and having those take precedence over the default X(const X&) CTOR.

And also careful not to apply to non-functions.

Note
Constructor with nullptr or a null function object - will produce a UNIQUE function value (according to operator==). ANY other function object - each time you call the constructor - you will get a different (according to operator==) Function object. See http://stroika-bugs.sophists.com/browse/STK-960 for some of the reasoning behind this.

Member Function Documentation

◆ ToString()

template<typename FUNCTION_SIGNATURE >
Characters::String Stroika::Foundation::Execution::Function< FUNCTION_SIGNATURE >::ToString ( ) const
See also
Characters::ToString ();

Definition at line 65 of file Function.inl.


The documentation for this class was generated from the following files: