#ifndef __JLANG__JCONVERSION__ #define __JLANG__JCONVERSION__ #include #include "JLang/JAssert.hh" /** * \author mdejong */ namespace JLANG {} namespace JPP { using namespace JLANG; } namespace JLANG { /** * Template class test for polymorphism. */ template struct JConversion { static const bool is_derived = std::is_base_of::value; //!< true, if JDerived_t derives from JBase_t static const bool is_same = std::is_same ::value; //!< true, if JDerived_t is equal to JBase_t }; /** * Specialisation of JConversion for identical types. */ template struct JConversion { static const bool is_derived = true; static const bool is_same = true; }; /** * Auxialiary class to assert type conversion. */ template::is_derived> class JAssertConversion; /** * Implementation of a valid type conversion. */ template class JAssertConversion {}; } #endif