Jpp  17.3.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JConstructor.hh
Go to the documentation of this file.
1 #ifndef __JLANG__JCONSTRUCTOR__
2 #define __JLANG__JCONSTRUCTOR__
3 
4 #include "JLang/JTest.hh"
5 
6 /**
7  * \author mdejong
8  */
9 
10 namespace JLANG {}
11 namespace JPP { using namespace JLANG; }
12 
13 namespace JLANG {
14 
15  /**
16  * Template class test for availability of a suitable constructor <tt>JType_t(const JArgument_t)</tt>.
17  */
18  template<class JType_t, class JArgument_t>
19  class JConstructor :
20  public JTest
21  {
22  using JTest::test;
23 
24  static JTrue test(const JType_t&);
25 
26  static const JArgument_t& getReference();
27 
28  public:
29  static const bool has_constructor = JTEST(test(getReference())); //!< true if JType_t can be constructed from JArgument_t; else false
30  };
31 }
32 
33 #endif
static const JArgument_t & getReference()
#define JTEST(__A__)
Test macro.
Definition: JTest.hh:45
static JFalse test(...)
default false
static const bool has_constructor
true if JType_t can be constructed from JArgument_t; else false
Definition: JConstructor.hh:29
Auxiliary base class for compile time evaluation of test.
Definition: JTest.hh:21
definition of true
Definition: JTest.hh:24
static JTrue test(const JType_t &)
Template class test for availability of a suitable constructor JType_t(const JArgument_t).
Definition: JConstructor.hh:19