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// <map> 11 12// template <class Key, class T, class Compare = less<Key>, 13// class Allocator = allocator<pair<const Key, T>>> 14// class multimap 15// { 16// public: 17// // types: 18// typedef Key key_type; 19// typedef T mapped_type; 20// typedef pair<const key_type, mapped_type> value_type; 21// typedef Compare key_compare; 22// typedef Allocator allocator_type; 23// typedef typename allocator_type::reference reference; 24// typedef typename allocator_type::const_reference const_reference; 25// typedef typename allocator_type::pointer pointer; 26// typedef typename allocator_type::const_pointer const_pointer; 27// typedef typename allocator_type::size_type size_type; 28// typedef typename allocator_type::difference_type difference_type; 29// ... 30// }; 31 32#include <map> 33#include <type_traits> 34 35#include "min_allocator.h" 36 37int main() 38{ 39 { 40 static_assert((std::is_same<std::multimap<int, double>::key_type, int>::value), ""); 41 static_assert((std::is_same<std::multimap<int, double>::mapped_type, double>::value), ""); 42 static_assert((std::is_same<std::multimap<int, double>::value_type, std::pair<const int, double> >::value), ""); 43 static_assert((std::is_same<std::multimap<int, double>::key_compare, std::less<int> >::value), ""); 44 static_assert((std::is_same<std::multimap<int, double>::allocator_type, std::allocator<std::pair<const int, double> > >::value), ""); 45 static_assert((std::is_same<std::multimap<int, double>::reference, std::pair<const int, double>&>::value), ""); 46 static_assert((std::is_same<std::multimap<int, double>::const_reference, const std::pair<const int, double>&>::value), ""); 47 static_assert((std::is_same<std::multimap<int, double>::pointer, std::pair<const int, double>*>::value), ""); 48 static_assert((std::is_same<std::multimap<int, double>::const_pointer, const std::pair<const int, double>*>::value), ""); 49 static_assert((std::is_same<std::multimap<int, double>::size_type, std::size_t>::value), ""); 50 static_assert((std::is_same<std::multimap<int, double>::difference_type, std::ptrdiff_t>::value), ""); 51 } 52#if __cplusplus >= 201103L 53 { 54 static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::key_type, int>::value), ""); 55 static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::mapped_type, double>::value), ""); 56 static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::value_type, std::pair<const int, double> >::value), ""); 57 static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::key_compare, std::less<int> >::value), ""); 58 static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::allocator_type, min_allocator<std::pair<const int, double> > >::value), ""); 59 static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::reference, std::pair<const int, double>&>::value), ""); 60 static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::const_reference, const std::pair<const int, double>&>::value), ""); 61 static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::pointer, min_pointer<std::pair<const int, double>>>::value), ""); 62 static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::const_pointer, min_pointer<const std::pair<const int, double>>>::value), ""); 63 static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::size_type, std::size_t>::value), ""); 64 static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::difference_type, std::ptrdiff_t>::value), ""); 65 } 66#endif 67} 68