1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // template <class Alloc>
13 // struct allocator_traits
15 // static pointer allocate(allocator_type& a, size_type n, const_void_pointer hint);
23 #include "test_macros.h"
30 value_type* allocate(std::size_t n)
33 return reinterpret_cast<value_type*>(static_cast<std::uintptr_t>(0xDEADBEEF));
42 value_type* allocate(std::size_t n)
45 return reinterpret_cast<value_type*>(static_cast<std::uintptr_t>(0xEEADBEEF));
47 value_type* allocate(std::size_t n, const void* p)
51 return reinterpret_cast<value_type*>(static_cast<std::uintptr_t>(0xFEADBEEF));
57 #if TEST_STD_VER >= 11
59 assert(std::allocator_traits<A<int> >::allocate(a, 10, nullptr) == reinterpret_cast<int*>(static_cast<std::uintptr_t>(0xDEADBEEF)));
62 assert(std::allocator_traits<B<int> >::allocate(b, 11, nullptr) == reinterpret_cast<int*>(static_cast<std::uintptr_t>(0xFEADBEEF)));