GCC before 4.5 does not have a standard C ++ 0x type template has_nothrow_move_constructor. I could use it in my package for optimization, but I do not want to exclude one of the common compilers and I do not want to overload the configuration with symbols such as HAVE_STD_HAS_NOTHROW_MOVE_CONSTRUCTOR. Is it possible to use this template, if it exists, and simply return to copying if it is missing, without using any predefined configuration characters? I also do not want to depend on Boost, since my library is small and does not need Boost for other reasons.
In pseudo code, I need something like:
template <typename type>
struct has_nothrow_move_constructor_robust
: public integral_constant <bool,
has_nothrow_move_constructor <type>::value
false>
{ };
Since move constructors are only for C ++ 0x anyway, I don't mind using other C ++ 0x functions for the above definition, if at all possible.
source
share