#ifndef QQMLHELPERSCOMMON_H #define QQMLHELPERSCOMMON_H #include // NOTE : SFINAE trickery to find which type is the cheapest between T and const T & template struct CheapestType { typedef const T & type_def; }; template<> struct CheapestType { typedef bool type_def; }; template<> struct CheapestType { typedef quint8 type_def; }; template<> struct CheapestType { typedef quint16 type_def; }; template<> struct CheapestType { typedef quint32 type_def; }; template<> struct CheapestType { typedef quint64 type_def; }; template<> struct CheapestType { typedef qint8 type_def; }; template<> struct CheapestType { typedef qint16 type_def; }; template<> struct CheapestType { typedef qint32 type_def; }; template<> struct CheapestType { typedef qint64 type_def; }; template<> struct CheapestType { typedef float type_def; }; template<> struct CheapestType { typedef double type_def; }; template struct CheapestType { typedef T * type_def; }; // NOTE : define to add/remove 'get_' prefix on getters #ifdef QTQMLTRICKS_NO_PREFIX_ON_GETTERS # define MAKE_GETTER_NAME(name) name #else # define MAKE_GETTER_NAME(name) get_##name #endif #endif // QQMLHELPERSCOMMON_H