summaryrefslogtreecommitdiffstats
path: root/libcxx/test/libcxx/memory/is_allocator.pass.cpp
blob: 95f1079d61a5a1695b44a3b5d56c10255a9ace07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//===----------------------------------------------------------------------===//
//
//                     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.
//
//===----------------------------------------------------------------------===//
//

// <memory>
// UNSUPPORTED: c++98, c++03, c++11, c++14

// template<typename _Alloc>
// struct __is_allocator;

// Is either true_type or false_type depending on if A is an allocator.

#include <memory>
#include <string>

#include "test_macros.h"
#include "min_allocator.h"
#include "test_allocator.h"

template <typename T>
void test_allocators()
{
	static_assert(!std::__is_allocator<T>::value, "" );
	static_assert( std::__is_allocator<std::allocator<T>>::value, "" );
	static_assert( std::__is_allocator<test_allocator<T>>::value, "" );
	static_assert( std::__is_allocator<min_allocator<T>>::value, "" );
}


int main()
{
//	test_allocators<void>();
	test_allocators<char>();
	test_allocators<int>();
	test_allocators<std::string>();
}
OpenPOWER on IntegriCloud