Utopia  2
Framework for studying models of complex & adaptive systems.
Public Types | List of all members
Utopia::rule_invoke_result< State, Rule, Args > Class Template Reference

Helper class for checking rule signatures and return types. More...

#include <apply.hh>

Public Types

using type = std::invoke_result_t< Rule, typename std::remove_reference_t< Args >::reference... >
 Report rule invoke result. More...
 

Detailed Description

template<typename State, typename Rule, typename... Args>
class Utopia::rule_invoke_result< State, Rule, Args >

Helper class for checking rule signatures and return types.

This class checks if a rule can be invoked with the given arguments (note that Args are expected to be conainers/sequences of the actual arguments) and reports the rule return type. It also statically checks if the rule return type can be converted to the expected state, but only if the rule does not return void.

Template Parameters
StateThe state type of the entities this rule is applied on
RuleThe type of the rule
ArgsOne or multiple containers with rule arguments

Member Typedef Documentation

◆ type

template<typename State , typename Rule , typename... Args>
using Utopia::rule_invoke_result< State, Rule, Args >::type = std::invoke_result_t< Rule, typename std::remove_reference_t<Args>::reference...>

Report rule invoke result.


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