//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct pointer_traits // { // template using rebind =
; // ... // }; #include #include template struct A { }; template struct B1 {}; template struct B { #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES template using rebind = B1; #else template struct rebind {typedef B1 other;}; #endif }; template struct C { }; template struct D1 {}; template struct D { #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES template using rebind = D1; #else template struct rebind {typedef D1 other;}; #endif }; int main() { #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES static_assert((std::is_same >::rebind, A >::value), ""); static_assert((std::is_same >::rebind, B1 >::value), ""); static_assert((std::is_same >::rebind, C >::value), ""); static_assert((std::is_same >::rebind, D1 >::value), ""); #else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES static_assert((std::is_same >::rebind::other, A >::value), ""); static_assert((std::is_same >::rebind::other, B1 >::value), ""); static_assert((std::is_same >::rebind::other, C >::value), ""); static_assert((std::is_same >::rebind::other, D1 >::value), ""); #endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES }