types.pass.cpp revision bc8d3f97eb5c958007f2713238472e0c1c8fe02c
1//===----------------------------------------------------------------------===// 2// 3// ��������������������The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10// <unordered_set> 11 12// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, 13// class Alloc = allocator<Value>> 14// class unordered_multiset 15// { 16// public: 17// // types 18// typedef Value value_type; 19// typedef value_type key_type; 20// typedef Hash hasher; 21// typedef Pred key_equal; 22// typedef Alloc allocator_type; 23// typedef value_type& reference; 24// typedef const value_type& const_reference; 25// typedef typename allocator_traits<allocator_type>::pointer pointer; 26// typedef typename allocator_traits<allocator_type>::const_pointer const_pointer; 27// typedef typename allocator_traits<allocator_type>::size_type size_type; 28// typedef typename allocator_traits<allocator_type>::difference_type difference_type; 29 30#include <unordered_set> 31#include <type_traits> 32 33int main() 34{ 35 { 36 typedef std::unordered_multiset<short> C; 37 static_assert((std::is_same<C::value_type, short>::value), ""); 38 static_assert((std::is_same<C::key_type, short>::value), ""); 39 static_assert((std::is_same<C::hasher, std::hash<C::key_type> >::value), ""); 40 static_assert((std::is_same<C::key_equal, std::equal_to<C::key_type> >::value), ""); 41 static_assert((std::is_same<C::allocator_type, std::allocator<C::value_type> >::value), ""); 42 static_assert((std::is_same<C::reference, C::value_type&>::value), ""); 43 static_assert((std::is_same<C::const_reference, const C::value_type&>::value), ""); 44 static_assert((std::is_same<C::pointer, C::value_type*>::value), ""); 45 static_assert((std::is_same<C::const_pointer, const C::value_type*>::value), ""); 46 static_assert((std::is_same<C::size_type, std::size_t>::value), ""); 47 static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), ""); 48 } 49} 50