//===----------------------------------------------------------------------===// // // 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 allocator_traits // { // template using rebind_traits = allocator_traits>; // ... // }; #include #include #include "test_macros.h" template struct ReboundA {}; template struct A { typedef T value_type; template struct rebind {typedef ReboundA other;}; }; template struct ReboundB {}; template struct B { typedef T value_type; template struct rebind {typedef ReboundB other;}; }; template struct C { typedef T value_type; }; template struct D { typedef T value_type; }; template struct E { typedef T value_type; template struct rebind {typedef ReboundA otter;}; }; int main() { #if TEST_STD_VER >= 11 static_assert((std::is_same >::rebind_traits, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits, std::allocator_traits > >::value), ""); #else static_assert((std::is_same >::rebind_traits::other, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits::other, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits::other, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits::other, std::allocator_traits > >::value), ""); static_assert((std::is_same >::rebind_traits::other, std::allocator_traits > >::value), ""); #endif }