I have a problem with the 'using' keyword in C ++ 11. This piece of code should create an alias for a pointer to another type.
template <typename T> class SomeClass { typedef typename std::add_pointer<T>::type pointer; template <typename U> using rebind_pointer = typename std::pointer_traits<pointer>::rebind<U>; } SomeClass<int> obj;
But in gcc 4.7 I have a compilation error:
typename std::pointer_traits<int*>::rebind names template<class _Up> using rebind = _Up* , which is not a type
I found out that pointer_traits :: rebind is its own template alias, so maybe this is a problem?
eucpp source share