diff --git a/octa/traits.h b/octa/traits.h index 99f2949..edc95b4 100644 --- a/octa/traits.h +++ b/octa/traits.h @@ -160,6 +160,42 @@ namespace octa { (IsLvalueReference::value || IsRvalueReference::value) > {}; + /* add lvalue reference */ + + template struct AddLvalueReference { typedef T &type; }; + template struct AddLvalueReference { typedef T &type; }; + template struct AddLvalueReference { typedef T &type; }; + template<> struct AddLvalueReference { + typedef void type; + }; + template<> struct AddLvalueReference { + typedef const void type; + }; + template<> struct AddLvalueReference { + typedef volatile void type; + }; + template<> struct AddLvalueReference { + typedef const volatile void type; + }; + + /* add rvalue reference */ + + template struct AddRvalueReference { typedef T &&type; }; + template struct AddRvalueReference { typedef T &&type; }; + template struct AddRvalueReference { typedef T &&type; }; + template<> struct AddRvalueReference { + typedef void type; + }; + template<> struct AddRvalueReference { + typedef const void type; + }; + template<> struct AddRvalueReference { + typedef volatile void type; + }; + template<> struct AddRvalueReference { + typedef const volatile void type; + }; + /* is array */ template struct IsArray : false_t {};