blob: 0477d9912e6ecf85c4d729300b6dc56201530781 [file] [log] [blame]
Howard Hinnantc52f43e2010-08-22 00:59:46 +00001//===----------------------------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
Howard Hinnantb64f8b02010-11-16 22:09:02 +00005// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
Howard Hinnantc52f43e2010-08-22 00:59:46 +00007//
8//===----------------------------------------------------------------------===//
9
10// <memory>
11
12// template <class T, class Alloc> struct uses_allocator;
13
14#include <memory>
15#include <vector>
16
17struct A
18{
19};
20
21struct B
22{
23 typedef int allocator_type;
24};
25
26int 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}