I assume that you have the "C ++ Standard Library" installed on "libC ++". If so, you want <type_traits> , not <tr1/type_traits> . libC ++ gives you the C ++ 11 library, while libstdC ++ (which is also the default in Xcode 4.5) gives you the C ++ 03 library with tr1 support.
If you want, you can automatically determine which library you are using:
#include <ciso646> // detect std::lib #ifdef _LIBCPP_VERSION // using libc++ #include <type_traits> #else // using libstdc++ #include <tr1/type_traits> #endif
Or in your case itβs possible:
#include <ciso646> // detect std::lib #ifdef _LIBCPP_VERSION // using libc++ #define HAVE_TYPE_TRAITS #else // using libstdc++ #define HAVE_TR1_TYPE_TRAITS #endif
source share