/* * StatusTemplate.hpp * * Created on: 29 сент. 2019 г. * Author: user */ #ifndef SOURCE_SCHEMATIC_STATUSTEMPLATE_HPP_ #define SOURCE_SCHEMATIC_STATUSTEMPLATE_HPP_ #include "../systemic/IStatus.hh" #if __cplusplus >= 201103L #include #endif namespace systemic { namespace detail { template class TemplateStatus : public IStatus { Function & function; public: TemplateStatus(Function & f) : function(f) {} operator bool() const { return function(); } }; #if __cplusplus >= 201103L class FunctionalStatus : public systemic::IStatus { std::function f; public: FunctionalStatus( std::function _f) : f(_f) {} operator bool() const { return f(); } }; #endif }} #endif /* SOURCE_SCHEMATIC_STATUSTEMPLATE_HPP_ */