1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 // <memory> 11 12 // template <> 13 // class allocator<void> 14 // { 15 // public: 16 // typedef void* pointer; 17 // typedef const void* const_pointer; 18 // typedef void value_type; 19 // 20 // template <class _Up> struct rebind {typedef allocator<_Up> other;}; 21 // }; 22 23 #include <memory> 24 #include <type_traits> 25 main()26int main() 27 { 28 static_assert((std::is_same<std::allocator<void>::pointer, void*>::value), ""); 29 static_assert((std::is_same<std::allocator<void>::const_pointer, const void*>::value), ""); 30 static_assert((std::is_same<std::allocator<void>::value_type, void>::value), ""); 31 static_assert((std::is_same<std::allocator<void>::rebind<int>::other, 32 std::allocator<int> >::value), ""); 33 std::allocator<void> a; 34 std::allocator<void> a2 = a; 35 a2 = a; 36 } 37