Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in std::map and std::multimap

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300600 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2017-04-18 21:08:06 +00:00
parent a3de1e063a
commit ce924dce57
22 changed files with 79 additions and 146 deletions

View File

@@ -582,7 +582,7 @@ public:
__second_constructed(false) __second_constructed(false)
{} {}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
__map_node_destructor(__tree_node_destructor<allocator_type>&& __x) _NOEXCEPT __map_node_destructor(__tree_node_destructor<allocator_type>&& __x) _NOEXCEPT
: __na_(__x.__na_), : __na_(__x.__na_),
@@ -591,7 +591,7 @@ public:
{ {
__x.__value_constructed = false; __x.__value_constructed = false;
} }
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES #endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
void operator()(pointer __p) _NOEXCEPT void operator()(pointer __p) _NOEXCEPT
@@ -667,7 +667,7 @@ private:
~__value_type(); ~__value_type();
}; };
#endif #endif // _LIBCPP_CXX03_LANG
template <class _Tp> template <class _Tp>
struct __extract_key_value_types; struct __extract_key_value_types;
@@ -921,7 +921,7 @@ public:
return *this; return *this;
} }
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
map(map&& __m) map(map&& __m)
@@ -940,10 +940,6 @@ public:
return *this; return *this;
} }
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
map(initializer_list<value_type> __il, const key_compare& __comp = key_compare()) map(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
: __tree_(__vc(__comp)) : __tree_(__vc(__comp))
@@ -971,7 +967,7 @@ public:
return *this; return *this;
} }
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS #endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
explicit map(const allocator_type& __a) explicit map(const allocator_type& __a)
@@ -1082,6 +1078,10 @@ public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __p, value_type&& __v) iterator insert(const_iterator __p, value_type&& __v)
{return __tree_.__insert_unique(__p.__i_, _VSTD::move(__v));} {return __tree_.__insert_unique(__p.__i_, _VSTD::move(__v));}
_LIBCPP_INLINE_VISIBILITY
void insert(initializer_list<value_type> __il)
{insert(__il.begin(), __il.end());}
#endif #endif
template <class _InputIterator> template <class _InputIterator>
@@ -1092,14 +1092,6 @@ public:
insert(__e.__i_, *__f); insert(__e.__i_, *__f);
} }
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
_LIBCPP_INLINE_VISIBILITY
void insert(initializer_list<value_type> __il)
{insert(__il.begin(), __il.end());}
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
#if _LIBCPP_STD_VER > 14 #if _LIBCPP_STD_VER > 14
template <class... _Args> template <class... _Args>
@@ -1194,7 +1186,7 @@ public:
return emplace_hint(__h, _VSTD::move(__k), _VSTD::forward<_Vp>(__v)); return emplace_hint(__h, _VSTD::move(__k), _VSTD::forward<_Vp>(__v));
} }
#endif #endif // _LIBCPP_STD_VER > 14
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __tree_.erase(__p.__i_);} iterator erase(const_iterator __p) {return __tree_.erase(__p.__i_);}
@@ -1307,7 +1299,6 @@ private:
#ifndef _LIBCPP_CXX03_LANG #ifndef _LIBCPP_CXX03_LANG
template <class _Key, class _Tp, class _Compare, class _Allocator> template <class _Key, class _Tp, class _Compare, class _Allocator>
map<_Key, _Tp, _Compare, _Allocator>::map(map&& __m, const allocator_type& __a) map<_Key, _Tp, _Compare, _Allocator>::map(map&& __m, const allocator_type& __a)
: __tree_(_VSTD::move(__m.__tree_), typename __base::allocator_type(__a)) : __tree_(_VSTD::move(__m.__tree_), typename __base::allocator_type(__a))
@@ -1321,10 +1312,27 @@ map<_Key, _Tp, _Compare, _Allocator>::map(map&& __m, const allocator_type& __a)
} }
} }
#endif // !_LIBCPP_CXX03_LANG template <class _Key, class _Tp, class _Compare, class _Allocator>
_Tp&
map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k)
{
return __tree_.__emplace_unique_key_args(__k,
_VSTD::piecewise_construct,
_VSTD::forward_as_tuple(__k),
_VSTD::forward_as_tuple()).first->__cc.second;
}
template <class _Key, class _Tp, class _Compare, class _Allocator>
_Tp&
map<_Key, _Tp, _Compare, _Allocator>::operator[](key_type&& __k)
{
return __tree_.__emplace_unique_key_args(__k,
_VSTD::piecewise_construct,
_VSTD::forward_as_tuple(_VSTD::move(__k)),
_VSTD::forward_as_tuple()).first->__cc.second;
}
#ifdef _LIBCPP_CXX03_LANG #else // _LIBCPP_CXX03_LANG
template <class _Key, class _Tp, class _Compare, class _Allocator> template <class _Key, class _Tp, class _Compare, class _Allocator>
typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder
@@ -1355,29 +1363,7 @@ map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k)
return __r->__value_.__cc.second; return __r->__value_.__cc.second;
} }
#else #endif // _LIBCPP_CXX03_LANG
template <class _Key, class _Tp, class _Compare, class _Allocator>
_Tp&
map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k)
{
return __tree_.__emplace_unique_key_args(__k,
_VSTD::piecewise_construct,
_VSTD::forward_as_tuple(__k),
_VSTD::forward_as_tuple()).first->__cc.second;
}
template <class _Key, class _Tp, class _Compare, class _Allocator>
_Tp&
map<_Key, _Tp, _Compare, _Allocator>::operator[](key_type&& __k)
{
return __tree_.__emplace_unique_key_args(__k,
_VSTD::piecewise_construct,
_VSTD::forward_as_tuple(_VSTD::move(__k)),
_VSTD::forward_as_tuple()).first->__cc.second;
}
#endif // !_LIBCPP_CXX03_LANG
template <class _Key, class _Tp, class _Compare, class _Allocator> template <class _Key, class _Tp, class _Compare, class _Allocator>
_Tp& _Tp&
@@ -1593,7 +1579,7 @@ public:
return *this; return *this;
} }
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
multimap(multimap&& __m) multimap(multimap&& __m)
@@ -1612,10 +1598,6 @@ public:
return *this; return *this;
} }
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
multimap(initializer_list<value_type> __il, const key_compare& __comp = key_compare()) multimap(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
: __tree_(__vc(__comp)) : __tree_(__vc(__comp))
@@ -1643,7 +1625,7 @@ public:
return *this; return *this;
} }
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS #endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
explicit multimap(const allocator_type& __a) explicit multimap(const allocator_type& __a)
@@ -1736,6 +1718,11 @@ public:
iterator insert(const_iterator __p, value_type&& __v) iterator insert(const_iterator __p, value_type&& __v)
{return __tree_.__insert_multi(__p.__i_, _VSTD::move(__v));} {return __tree_.__insert_multi(__p.__i_, _VSTD::move(__v));}
_LIBCPP_INLINE_VISIBILITY
void insert(initializer_list<value_type> __il)
{insert(__il.begin(), __il.end());}
#endif // _LIBCPP_CXX03_LANG #endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
@@ -1753,14 +1740,6 @@ public:
__tree_.__insert_multi(__e.__i_, *__f); __tree_.__insert_multi(__e.__i_, *__f);
} }
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
_LIBCPP_INLINE_VISIBILITY
void insert(initializer_list<value_type> __il)
{insert(__il.begin(), __il.end());}
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __tree_.erase(__p.__i_);} iterator erase(const_iterator __p) {return __tree_.erase(__p.__i_);}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY

View File

@@ -7,6 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <map> // <map>
// class map // class map
@@ -17,17 +19,13 @@
#include <map> #include <map>
#ifndef _LIBCPP_HAS_NO_VARIADICS
#include <tuple> #include <tuple>
#endif
int main() int main()
{ {
#ifndef _LIBCPP_HAS_NO_VARIADICS
using namespace std; using namespace std;
map<tuple<int,int>, size_t> m; map<tuple<int,int>, size_t> m;
m[make_tuple(2,3)]=7; m[make_tuple(2,3)]=7;
#endif
} }

View File

@@ -7,6 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <map> // <map>
// class map // class map
@@ -20,7 +22,6 @@
int main() int main()
{ {
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{ {
typedef std::pair<const int, double> V; typedef std::pair<const int, double> V;
std::map<int, double> m = std::map<int, double> m =
@@ -45,7 +46,6 @@ int main()
assert(*next(m.begin()) == V(2, 1)); assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1)); assert(*next(m.begin(), 2) == V(3, 1));
} }
#if TEST_STD_VER >= 11
{ {
typedef std::pair<const int, double> V; typedef std::pair<const int, double> V;
std::map<int, double, std::less<int>, min_allocator<V>> m = std::map<int, double, std::less<int>, min_allocator<V>> m =
@@ -70,6 +70,4 @@ int main()
assert(*next(m.begin()) == V(2, 1)); assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1)); assert(*next(m.begin(), 2) == V(3, 1));
} }
#endif
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
} }

View File

@@ -7,6 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <map> // <map>
// class map // class map
@@ -20,7 +22,6 @@
int main() int main()
{ {
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{ {
typedef std::pair<const int, double> V; typedef std::pair<const int, double> V;
std::map<int, double> m = std::map<int, double> m =
@@ -41,7 +42,6 @@ int main()
assert(*next(m.begin()) == V(2, 1)); assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1)); assert(*next(m.begin(), 2) == V(3, 1));
} }
#if TEST_STD_VER >= 11
{ {
typedef std::pair<const int, double> V; typedef std::pair<const int, double> V;
std::map<int, double, std::less<int>, min_allocator<V>> m = std::map<int, double, std::less<int>, min_allocator<V>> m =
@@ -62,6 +62,4 @@ int main()
assert(*next(m.begin()) == V(2, 1)); assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1)); assert(*next(m.begin(), 2) == V(3, 1));
} }
#endif
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
} }

View File

@@ -7,6 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <map> // <map>
// class map // class map
@@ -20,7 +22,6 @@
int main() int main()
{ {
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{ {
typedef std::pair<const int, double> V; typedef std::pair<const int, double> V;
typedef test_compare<std::less<int> > C; typedef test_compare<std::less<int> > C;
@@ -42,7 +43,6 @@ int main()
assert(*next(m.begin(), 2) == V(3, 1)); assert(*next(m.begin(), 2) == V(3, 1));
assert(m.key_comp() == C(3)); assert(m.key_comp() == C(3));
} }
#if TEST_STD_VER >= 11
{ {
typedef std::pair<const int, double> V; typedef std::pair<const int, double> V;
typedef test_compare<std::less<int> > C; typedef test_compare<std::less<int> > C;
@@ -64,6 +64,4 @@ int main()
assert(*next(m.begin(), 2) == V(3, 1)); assert(*next(m.begin(), 2) == V(3, 1));
assert(m.key_comp() == C(3)); assert(m.key_comp() == C(3));
} }
#endif
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
} }

View File

@@ -7,6 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <map> // <map>
// class map // class map
@@ -21,7 +23,6 @@
int main() int main()
{ {
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{ {
typedef std::pair<const int, double> V; typedef std::pair<const int, double> V;
typedef test_compare<std::less<int> > C; typedef test_compare<std::less<int> > C;
@@ -45,7 +46,6 @@ int main()
assert(m.key_comp() == C(3)); assert(m.key_comp() == C(3));
assert(m.get_allocator() == A(6)); assert(m.get_allocator() == A(6));
} }
#if TEST_STD_VER >= 11
{ {
typedef std::pair<const int, double> V; typedef std::pair<const int, double> V;
typedef test_compare<std::less<int> > C; typedef test_compare<std::less<int> > C;
@@ -69,7 +69,6 @@ int main()
assert(m.key_comp() == C(3)); assert(m.key_comp() == C(3));
assert(m.get_allocator() == A()); assert(m.get_allocator() == A());
} }
#if TEST_STD_VER > 11
{ {
typedef std::pair<const int, double> V; typedef std::pair<const int, double> V;
typedef min_allocator<V> A; typedef min_allocator<V> A;
@@ -94,7 +93,6 @@ int main()
assert(*next(m.begin(), 2) == V(3, 1)); assert(*next(m.begin(), 2) == V(3, 1));
assert(m.get_allocator() == a); assert(m.get_allocator() == a);
} }
#endif
{ {
typedef std::pair<const int, double> V; typedef std::pair<const int, double> V;
typedef explicit_allocator<V> A; typedef explicit_allocator<V> A;
@@ -119,6 +117,4 @@ int main()
assert(m.key_comp() == C(3)); assert(m.key_comp() == C(3));
assert(m.get_allocator() == a); assert(m.get_allocator() == a);
} }
#endif
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
} }

View File

@@ -7,6 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <map> // <map>
// class map // class map
@@ -22,7 +24,6 @@
int main() int main()
{ {
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
typedef std::pair<const int, double> V; typedef std::pair<const int, double> V;
{ {
typedef test_compare<std::less<int> > C; typedef test_compare<std::less<int> > C;
@@ -69,7 +70,6 @@ int main()
assert(mo.size() == 0); assert(mo.size() == 0);
assert(distance(mo.begin(), mo.end()) == 0); assert(distance(mo.begin(), mo.end()) == 0);
} }
#if TEST_STD_VER >= 11
{ {
typedef test_compare<std::less<int> > C; typedef test_compare<std::less<int> > C;
typedef min_allocator<V> A; typedef min_allocator<V> A;
@@ -115,6 +115,4 @@ int main()
assert(mo.size() == 0); assert(mo.size() == 0);
assert(distance(mo.begin(), mo.end()) == 0); assert(distance(mo.begin(), mo.end()) == 0);
} }
#endif
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
} }

View File

@@ -7,6 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <map> // <map>
// class map // class map
@@ -24,7 +26,6 @@
int main() int main()
{ {
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{ {
typedef std::pair<MoveOnly, MoveOnly> V; typedef std::pair<MoveOnly, MoveOnly> V;
typedef std::pair<const MoveOnly, MoveOnly> VC; typedef std::pair<const MoveOnly, MoveOnly> VC;
@@ -189,7 +190,6 @@ int main()
} }
assert(Counter_base::gConstructed == 0); assert(Counter_base::gConstructed == 0);
} }
#if TEST_STD_VER >= 11
{ {
typedef std::pair<MoveOnly, MoveOnly> V; typedef std::pair<MoveOnly, MoveOnly> V;
typedef std::pair<const MoveOnly, MoveOnly> VC; typedef std::pair<const MoveOnly, MoveOnly> VC;
@@ -268,6 +268,4 @@ int main()
assert(m3.key_comp() == C(5)); assert(m3.key_comp() == C(5));
assert(m1.empty()); assert(m1.empty());
} }
#endif
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
} }

View File

@@ -7,6 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <map> // <map>
// class map // class map
@@ -23,7 +25,6 @@
int main() int main()
{ {
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{ {
typedef std::pair<MoveOnly, MoveOnly> V; typedef std::pair<MoveOnly, MoveOnly> V;
typedef std::pair<const MoveOnly, MoveOnly> VC; typedef std::pair<const MoveOnly, MoveOnly> VC;
@@ -144,7 +145,6 @@ int main()
assert(m3.key_comp() == C(5)); assert(m3.key_comp() == C(5));
assert(m1.empty()); assert(m1.empty());
} }
#if TEST_STD_VER >= 11
{ {
typedef std::pair<MoveOnly, MoveOnly> V; typedef std::pair<MoveOnly, MoveOnly> V;
typedef std::pair<const MoveOnly, MoveOnly> VC; typedef std::pair<const MoveOnly, MoveOnly> VC;
@@ -185,6 +185,4 @@ int main()
assert(m3.key_comp() == C(5)); assert(m3.key_comp() == C(5));
assert(m1.empty()); assert(m1.empty());
} }
#endif
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
} }

View File

@@ -7,6 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <map> // <map>
// class map // class map
@@ -24,7 +26,6 @@
int main() int main()
{ {
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{ {
typedef std::map<int, DefaultOnly> M; typedef std::map<int, DefaultOnly> M;
typedef std::pair<M::iterator, bool> R; typedef std::pair<M::iterator, bool> R;
@@ -92,7 +93,6 @@ int main()
assert(m.begin()->first == 2); assert(m.begin()->first == 2);
assert(m.begin()->second == 3.5); assert(m.begin()->second == 3.5);
} }
#if TEST_STD_VER >= 11
{ {
typedef std::map<int, DefaultOnly, std::less<int>, min_allocator<std::pair<const int, DefaultOnly>>> M; typedef std::map<int, DefaultOnly, std::less<int>, min_allocator<std::pair<const int, DefaultOnly>>> M;
typedef std::pair<M::iterator, bool> R; typedef std::pair<M::iterator, bool> R;
@@ -160,6 +160,4 @@ int main()
assert(m.begin()->first == 2); assert(m.begin()->first == 2);
assert(m.begin()->second == 3.5); assert(m.begin()->second == 3.5);
} }
#endif
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
} }

View File

@@ -7,6 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <map> // <map>
// class map // class map
@@ -23,7 +25,6 @@
int main() int main()
{ {
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{ {
typedef std::map<int, DefaultOnly> M; typedef std::map<int, DefaultOnly> M;
typedef M::iterator R; typedef M::iterator R;
@@ -89,7 +90,6 @@ int main()
assert(m.begin()->first == 2); assert(m.begin()->first == 2);
assert(m.begin()->second == 3.5); assert(m.begin()->second == 3.5);
} }
#if TEST_STD_VER >= 11
{ {
typedef std::map<int, DefaultOnly, std::less<int>, min_allocator<std::pair<const int, DefaultOnly>>> M; typedef std::map<int, DefaultOnly, std::less<int>, min_allocator<std::pair<const int, DefaultOnly>>> M;
typedef M::iterator R; typedef M::iterator R;
@@ -155,6 +155,4 @@ int main()
assert(m.begin()->first == 2); assert(m.begin()->first == 2);
assert(m.begin()->second == 3.5); assert(m.begin()->second == 3.5);
} }
#endif
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
} }

View File

@@ -7,6 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <map> // <map>
// class map // class map
@@ -20,7 +22,6 @@
int main() int main()
{ {
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{ {
typedef std::pair<const int, double> V; typedef std::pair<const int, double> V;
std::map<int, double> m = std::map<int, double> m =
@@ -43,7 +44,6 @@ int main()
assert(*next(m.begin()) == V(2, 1)); assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1)); assert(*next(m.begin(), 2) == V(3, 1));
} }
#if TEST_STD_VER >= 11
{ {
typedef std::pair<const int, double> V; typedef std::pair<const int, double> V;
std::map<int, double, std::less<int>, min_allocator<V>> m = std::map<int, double, std::less<int>, min_allocator<V>> m =
@@ -66,6 +66,4 @@ int main()
assert(*next(m.begin()) == V(2, 1)); assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1)); assert(*next(m.begin(), 2) == V(3, 1));
} }
#endif
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
} }

View File

@@ -7,6 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <map> // <map>
// class multimap // class multimap
@@ -20,7 +22,6 @@
int main() int main()
{ {
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{ {
typedef std::multimap<int, double> C; typedef std::multimap<int, double> C;
typedef C::value_type V; typedef C::value_type V;
@@ -50,7 +51,6 @@ int main()
assert(*++i == V(3, 1.5)); assert(*++i == V(3, 1.5));
assert(*++i == V(3, 2)); assert(*++i == V(3, 2));
} }
#if TEST_STD_VER >= 11
{ {
typedef std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> C; typedef std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> C;
typedef C::value_type V; typedef C::value_type V;
@@ -80,6 +80,4 @@ int main()
assert(*++i == V(3, 1.5)); assert(*++i == V(3, 1.5));
assert(*++i == V(3, 2)); assert(*++i == V(3, 2));
} }
#endif
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
} }

View File

@@ -7,6 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <map> // <map>
// class multimap // class multimap
@@ -20,7 +22,6 @@
int main() int main()
{ {
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{ {
typedef std::multimap<int, double> C; typedef std::multimap<int, double> C;
typedef C::value_type V; typedef C::value_type V;
@@ -49,7 +50,6 @@ int main()
assert(*++i == V(3, 1.5)); assert(*++i == V(3, 1.5));
assert(*++i == V(3, 2)); assert(*++i == V(3, 2));
} }
#if TEST_STD_VER >= 11
{ {
typedef std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> C; typedef std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> C;
typedef C::value_type V; typedef C::value_type V;
@@ -78,6 +78,4 @@ int main()
assert(*++i == V(3, 1.5)); assert(*++i == V(3, 1.5));
assert(*++i == V(3, 2)); assert(*++i == V(3, 2));
} }
#endif
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
} }

View File

@@ -7,6 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <map> // <map>
// class multimap // class multimap
@@ -20,7 +22,6 @@
int main() int main()
{ {
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{ {
typedef test_compare<std::less<int> > Cmp; typedef test_compare<std::less<int> > Cmp;
typedef std::multimap<int, double, Cmp> C; typedef std::multimap<int, double, Cmp> C;
@@ -53,7 +54,6 @@ int main()
assert(*++i == V(3, 2)); assert(*++i == V(3, 2));
assert(m.key_comp() == Cmp(4)); assert(m.key_comp() == Cmp(4));
} }
#if TEST_STD_VER >= 11
{ {
typedef test_compare<std::less<int> > Cmp; typedef test_compare<std::less<int> > Cmp;
typedef std::multimap<int, double, Cmp, min_allocator<std::pair<const int, double>>> C; typedef std::multimap<int, double, Cmp, min_allocator<std::pair<const int, double>>> C;
@@ -86,6 +86,4 @@ int main()
assert(*++i == V(3, 2)); assert(*++i == V(3, 2));
assert(m.key_comp() == Cmp(4)); assert(m.key_comp() == Cmp(4));
} }
#endif
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
} }

View File

@@ -7,6 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <map> // <map>
// class multimap // class multimap
@@ -21,7 +23,6 @@
int main() int main()
{ {
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{ {
typedef test_compare<std::less<int> > Cmp; typedef test_compare<std::less<int> > Cmp;
typedef test_allocator<std::pair<const int, double> > A; typedef test_allocator<std::pair<const int, double> > A;
@@ -56,8 +57,6 @@ int main()
assert(m.key_comp() == Cmp(4)); assert(m.key_comp() == Cmp(4));
assert(m.get_allocator() == A(5)); assert(m.get_allocator() == A(5));
} }
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
#if TEST_STD_VER >= 11
{ {
typedef test_compare<std::less<int> > Cmp; typedef test_compare<std::less<int> > Cmp;
typedef min_allocator<std::pair<const int, double> > A; typedef min_allocator<std::pair<const int, double> > A;
@@ -92,7 +91,6 @@ int main()
assert(m.key_comp() == Cmp(4)); assert(m.key_comp() == Cmp(4));
assert(m.get_allocator() == A()); assert(m.get_allocator() == A());
} }
#if TEST_STD_VER > 11
{ {
typedef test_compare<std::less<int> > C; typedef test_compare<std::less<int> > C;
typedef std::pair<const int, double> V; typedef std::pair<const int, double> V;
@@ -124,7 +122,6 @@ int main()
assert(*++i == V(3, 2)); assert(*++i == V(3, 2));
assert(m.get_allocator() == a); assert(m.get_allocator() == a);
} }
#endif
{ {
typedef test_compare<std::less<int> > Cmp; typedef test_compare<std::less<int> > Cmp;
typedef explicit_allocator<std::pair<const int, double> > A; typedef explicit_allocator<std::pair<const int, double> > A;
@@ -159,5 +156,4 @@ int main()
assert(m.key_comp() == Cmp(4)); assert(m.key_comp() == Cmp(4));
assert(m.get_allocator() == A{}); assert(m.get_allocator() == A{});
} }
#endif
} }

View File

@@ -7,6 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <map> // <map>
// class multimap // class multimap
@@ -22,7 +24,6 @@
int main() int main()
{ {
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
typedef std::pair<const int, double> V; typedef std::pair<const int, double> V;
{ {
typedef test_compare<std::less<int> > C; typedef test_compare<std::less<int> > C;
@@ -75,7 +76,6 @@ int main()
assert(mo.size() == 0); assert(mo.size() == 0);
assert(distance(mo.begin(), mo.end()) == 0); assert(distance(mo.begin(), mo.end()) == 0);
} }
#if TEST_STD_VER >= 11
{ {
typedef test_compare<std::less<int> > C; typedef test_compare<std::less<int> > C;
typedef min_allocator<V> A; typedef min_allocator<V> A;
@@ -127,6 +127,4 @@ int main()
assert(mo.size() == 0); assert(mo.size() == 0);
assert(distance(mo.begin(), mo.end()) == 0); assert(distance(mo.begin(), mo.end()) == 0);
} }
#endif
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
} }

View File

@@ -7,6 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <map> // <map>
// class multimap // class multimap
@@ -24,7 +26,6 @@
int main() int main()
{ {
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{ {
typedef std::pair<MoveOnly, MoveOnly> V; typedef std::pair<MoveOnly, MoveOnly> V;
typedef std::pair<const MoveOnly, MoveOnly> VC; typedef std::pair<const MoveOnly, MoveOnly> VC;
@@ -189,7 +190,6 @@ int main()
} }
assert(Counter_base::gConstructed == 0); assert(Counter_base::gConstructed == 0);
} }
#if TEST_STD_VER >= 11
{ {
typedef std::pair<MoveOnly, MoveOnly> V; typedef std::pair<MoveOnly, MoveOnly> V;
typedef std::pair<const MoveOnly, MoveOnly> VC; typedef std::pair<const MoveOnly, MoveOnly> VC;
@@ -268,6 +268,4 @@ int main()
assert(m3.key_comp() == C(5)); assert(m3.key_comp() == C(5));
assert(m1.empty()); assert(m1.empty());
} }
#endif
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
} }

View File

@@ -7,6 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <map> // <map>
// class multimap // class multimap
@@ -23,7 +25,6 @@
int main() int main()
{ {
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{ {
typedef std::pair<MoveOnly, MoveOnly> V; typedef std::pair<MoveOnly, MoveOnly> V;
typedef std::pair<const MoveOnly, MoveOnly> VC; typedef std::pair<const MoveOnly, MoveOnly> VC;
@@ -144,7 +145,6 @@ int main()
assert(m3.key_comp() == C(5)); assert(m3.key_comp() == C(5));
assert(m1.empty()); assert(m1.empty());
} }
#if TEST_STD_VER >= 11
{ {
typedef std::pair<MoveOnly, MoveOnly> V; typedef std::pair<MoveOnly, MoveOnly> V;
typedef std::pair<const MoveOnly, MoveOnly> VC; typedef std::pair<const MoveOnly, MoveOnly> VC;
@@ -185,6 +185,4 @@ int main()
assert(m3.key_comp() == C(5)); assert(m3.key_comp() == C(5));
assert(m1.empty()); assert(m1.empty());
} }
#endif
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
} }

View File

@@ -7,6 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <map> // <map>
// class multimap // class multimap
@@ -23,7 +25,6 @@
int main() int main()
{ {
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{ {
typedef std::multimap<int, DefaultOnly> M; typedef std::multimap<int, DefaultOnly> M;
typedef M::iterator R; typedef M::iterator R;
@@ -84,7 +85,6 @@ int main()
assert(m.begin()->first == 2); assert(m.begin()->first == 2);
assert(m.begin()->second == 3.5); assert(m.begin()->second == 3.5);
} }
#if TEST_STD_VER >= 11
{ {
typedef std::multimap<int, DefaultOnly, std::less<int>, min_allocator<std::pair<const int, DefaultOnly>>> M; typedef std::multimap<int, DefaultOnly, std::less<int>, min_allocator<std::pair<const int, DefaultOnly>>> M;
typedef M::iterator R; typedef M::iterator R;
@@ -145,6 +145,4 @@ int main()
assert(m.begin()->first == 2); assert(m.begin()->first == 2);
assert(m.begin()->second == 3.5); assert(m.begin()->second == 3.5);
} }
#endif
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
} }

View File

@@ -7,6 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <map> // <map>
// class multimap // class multimap
@@ -23,7 +25,6 @@
int main() int main()
{ {
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{ {
typedef std::multimap<int, DefaultOnly> M; typedef std::multimap<int, DefaultOnly> M;
typedef M::iterator R; typedef M::iterator R;
@@ -89,7 +90,6 @@ int main()
assert(m.begin()->first == 2); assert(m.begin()->first == 2);
assert(m.begin()->second == 3.5); assert(m.begin()->second == 3.5);
} }
#if TEST_STD_VER >= 11
{ {
typedef std::multimap<int, DefaultOnly, std::less<int>, min_allocator<std::pair<const int, DefaultOnly>>> M; typedef std::multimap<int, DefaultOnly, std::less<int>, min_allocator<std::pair<const int, DefaultOnly>>> M;
typedef M::iterator R; typedef M::iterator R;
@@ -155,6 +155,4 @@ int main()
assert(m.begin()->first == 2); assert(m.begin()->first == 2);
assert(m.begin()->second == 3.5); assert(m.begin()->second == 3.5);
} }
#endif
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
} }

View File

@@ -7,6 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <map> // <map>
// class multimap // class multimap
@@ -20,7 +22,6 @@
int main() int main()
{ {
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{ {
typedef std::multimap<int, double> C; typedef std::multimap<int, double> C;
typedef C::value_type V; typedef C::value_type V;
@@ -53,7 +54,6 @@ int main()
assert(*++i == V(3, 2)); assert(*++i == V(3, 2));
assert(*++i == V(3, 1.5)); assert(*++i == V(3, 1.5));
} }
#if TEST_STD_VER >= 11
{ {
typedef std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> C; typedef std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> C;
typedef C::value_type V; typedef C::value_type V;
@@ -86,6 +86,4 @@ int main()
assert(*++i == V(3, 2)); assert(*++i == V(3, 2));
assert(*++i == V(3, 1.5)); assert(*++i == V(3, 1.5));
} }
#endif
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
} }