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 <class T, class Alloc> struct uses_allocator;
13
14 #include <memory>
15 #include <vector>
16
17 struct A
18 {
19 };
20
21 struct B
22 {
23 typedef int allocator_type;
24 };
25
main()26 int main()
27 {
28 static_assert((!std::uses_allocator<int, std::allocator<int> >::value), "");
29 static_assert(( std::uses_allocator<std::vector<int>, std::allocator<int> >::value), "");
30 static_assert((!std::uses_allocator<A, std::allocator<int> >::value), "");
31 static_assert((!std::uses_allocator<B, std::allocator<int> >::value), "");
32 static_assert(( std::uses_allocator<B, double>::value), "");
33 }
34