Jpp  18.2.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JResolve.hh
Go to the documentation of this file.
1 #ifndef __JLANG__JRESOLVE__
2 #define __JLANG__JRESOLVE__
3 
4 
5 /**
6  * \author mdejong
7  */
8 
9 namespace JLANG {}
10 namespace JPP { using namespace JLANG; }
11 
12 namespace JLANG {
13 
14  /**
15  * Test existence of class T.
16  */
17  template<class T>
18  class JResolve
19  {
20  template<class U> static auto exists(U*) -> decltype(sizeof(U) >= 0);
21  template<typename> static auto exists(...) -> std::false_type;
22 
23  public:
24  static const bool value = std::is_same<bool, decltype(exists<T>(0))>::value; //!< true if an implementation of class T exists; else false
25  };
26 }
27 
28 #endif
Test existence of class T.
Definition: JResolve.hh:18
static auto exists(U *) -> decltype(sizeof(U) >=0)
static const bool value
true if an implementation of class T exists; else false
Definition: JResolve.hh:24