nullary_function.hpp
Go to the documentation of this file.
1 
8 /*****************************************************************************
9 ** Ifdefs
10 *****************************************************************************/
11 
12 #ifndef ECL_CONCEPTS_NULLARY_FUNCTION_HPP_
13 #define ECL_CONCEPTS_NULLARY_FUNCTION_HPP_
14 
15 /*****************************************************************************
16 ** Includes
17 *****************************************************************************/
18 
19 #include "macros.hpp"
20 
21 /*****************************************************************************
22 ** Namespaces
23 *****************************************************************************/
24 
25 namespace ecl {
26 
27 /*****************************************************************************
28 ** Concept [Container]
29 *****************************************************************************/
30 
34 template <typename Implementation>
36  public:
37 
47  {
48  typedef typename Implementation::result_type return_type;
49  function();
50  // Unfortunately we can't test for the result type to match a certain value here
51  // as this would then have 2 template arguments with a separating comma. That throws
52  // the compile_time_concept_check macro into thinking it has two macro arguments.
53  }
54 
55  private:
56  // Putting instantiations here actually saves instantiation (which can cause a
57  // problem if there is no default constructor).
58  Implementation function;
59 };
60 
61 }; // namespace ecl
62 
63 #endif /* ECL_CONCEPTS_NULLARY_FUNCTION_HPP_ */
Embedded control libraries.
Mechanisms enabling compile time checking of metaprogramming concepts.
ecl_compile_time_concept_test(NullaryFunctionConcept)
Implements a concept test for nullary functions.
Defines validating functionality for the nullary function concept.


ecl_concepts
Author(s): Daniel Stonier
autogenerated on Mon Feb 28 2022 22:18:33