Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <list>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300414 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
108
include/list
108
include/list
@@ -860,11 +860,10 @@ public:
|
|||||||
list(const list& __c, const allocator_type& __a);
|
list(const list& __c, const allocator_type& __a);
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
list& operator=(const list& __c);
|
list& operator=(const list& __c);
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
#ifndef _LIBCPP_CXX03_LANG
|
||||||
list(initializer_list<value_type> __il);
|
list(initializer_list<value_type> __il);
|
||||||
list(initializer_list<value_type> __il, const allocator_type& __a);
|
list(initializer_list<value_type> __il, const allocator_type& __a);
|
||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
list(list&& __c)
|
list(list&& __c)
|
||||||
_NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value);
|
_NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value);
|
||||||
@@ -875,22 +874,20 @@ public:
|
|||||||
_NOEXCEPT_(
|
_NOEXCEPT_(
|
||||||
__node_alloc_traits::propagate_on_container_move_assignment::value &&
|
__node_alloc_traits::propagate_on_container_move_assignment::value &&
|
||||||
is_nothrow_move_assignable<__node_allocator>::value);
|
is_nothrow_move_assignable<__node_allocator>::value);
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
list& operator=(initializer_list<value_type> __il)
|
list& operator=(initializer_list<value_type> __il)
|
||||||
{assign(__il.begin(), __il.end()); return *this;}
|
{assign(__il.begin(), __il.end()); return *this;}
|
||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
void assign(initializer_list<value_type> __il)
|
||||||
|
{assign(__il.begin(), __il.end());}
|
||||||
|
#endif // _LIBCPP_CXX03_LANG
|
||||||
|
|
||||||
template <class _InpIter>
|
template <class _InpIter>
|
||||||
void assign(_InpIter __f, _InpIter __l,
|
void assign(_InpIter __f, _InpIter __l,
|
||||||
typename enable_if<__is_input_iterator<_InpIter>::value>::type* = 0);
|
typename enable_if<__is_input_iterator<_InpIter>::value>::type* = 0);
|
||||||
void assign(size_type __n, const value_type& __x);
|
void assign(size_type __n, const value_type& __x);
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
|
||||||
void assign(initializer_list<value_type> __il)
|
|
||||||
{assign(__il.begin(), __il.end());}
|
|
||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
allocator_type get_allocator() const _NOEXCEPT;
|
allocator_type get_allocator() const _NOEXCEPT;
|
||||||
@@ -964,10 +961,10 @@ public:
|
|||||||
return base::__end_.__prev_->__as_node()->__value_;
|
return base::__end_.__prev_->__as_node()->__value_;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_CXX03_LANG
|
||||||
void push_front(value_type&& __x);
|
void push_front(value_type&& __x);
|
||||||
void push_back(value_type&& __x);
|
void push_back(value_type&& __x);
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
|
||||||
template <class... _Args>
|
template <class... _Args>
|
||||||
#if _LIBCPP_STD_VER > 14
|
#if _LIBCPP_STD_VER > 14
|
||||||
reference emplace_front(_Args&&... __args);
|
reference emplace_front(_Args&&... __args);
|
||||||
@@ -982,9 +979,13 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
template <class... _Args>
|
template <class... _Args>
|
||||||
iterator emplace(const_iterator __p, _Args&&... __args);
|
iterator emplace(const_iterator __p, _Args&&... __args);
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
|
||||||
iterator insert(const_iterator __p, value_type&& __x);
|
iterator insert(const_iterator __p, value_type&& __x);
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
iterator insert(const_iterator __p, initializer_list<value_type> __il)
|
||||||
|
{return insert(__p, __il.begin(), __il.end());}
|
||||||
|
#endif // _LIBCPP_CXX03_LANG
|
||||||
|
|
||||||
void push_front(const value_type& __x);
|
void push_front(const value_type& __x);
|
||||||
void push_back(const value_type& __x);
|
void push_back(const value_type& __x);
|
||||||
@@ -994,11 +995,6 @@ public:
|
|||||||
template <class _InpIter>
|
template <class _InpIter>
|
||||||
iterator insert(const_iterator __p, _InpIter __f, _InpIter __l,
|
iterator insert(const_iterator __p, _InpIter __f, _InpIter __l,
|
||||||
typename enable_if<__is_input_iterator<_InpIter>::value>::type* = 0);
|
typename enable_if<__is_input_iterator<_InpIter>::value>::type* = 0);
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
|
||||||
iterator insert(const_iterator __p, initializer_list<value_type> __il)
|
|
||||||
{return insert(__p, __il.begin(), __il.end());}
|
|
||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void swap(list& __c)
|
void swap(list& __c)
|
||||||
@@ -1022,22 +1018,18 @@ public:
|
|||||||
void resize(size_type __n, const value_type& __x);
|
void resize(size_type __n, const value_type& __x);
|
||||||
|
|
||||||
void splice(const_iterator __p, list& __c);
|
void splice(const_iterator __p, list& __c);
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_CXX03_LANG
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void splice(const_iterator __p, list&& __c) {splice(__p, __c);}
|
void splice(const_iterator __p, list&& __c) {splice(__p, __c);}
|
||||||
#endif
|
|
||||||
void splice(const_iterator __p, list& __c, const_iterator __i);
|
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void splice(const_iterator __p, list&& __c, const_iterator __i)
|
void splice(const_iterator __p, list&& __c, const_iterator __i)
|
||||||
{splice(__p, __c, __i);}
|
{splice(__p, __c, __i);}
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
void splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l);
|
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void splice(const_iterator __p, list&& __c, const_iterator __f, const_iterator __l)
|
void splice(const_iterator __p, list&& __c, const_iterator __f, const_iterator __l)
|
||||||
{splice(__p, __c, __f, __l);}
|
{splice(__p, __c, __f, __l);}
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif
|
||||||
|
void splice(const_iterator __p, list& __c, const_iterator __i);
|
||||||
|
void splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l);
|
||||||
|
|
||||||
void remove(const value_type& __x);
|
void remove(const value_type& __x);
|
||||||
template <class _Pred> void remove_if(_Pred __pred);
|
template <class _Pred> void remove_if(_Pred __pred);
|
||||||
@@ -1047,17 +1039,17 @@ public:
|
|||||||
void unique(_BinaryPred __binary_pred);
|
void unique(_BinaryPred __binary_pred);
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void merge(list& __c);
|
void merge(list& __c);
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_CXX03_LANG
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void merge(list&& __c) {merge(__c);}
|
void merge(list&& __c) {merge(__c);}
|
||||||
#endif
|
|
||||||
template <class _Comp>
|
|
||||||
void merge(list& __c, _Comp __comp);
|
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
template <class _Comp>
|
template <class _Comp>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void merge(list&& __c, _Comp __comp) {merge(__c, __comp);}
|
void merge(list&& __c, _Comp __comp) {merge(__c, __comp);}
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif
|
||||||
|
template <class _Comp>
|
||||||
|
void merge(list& __c, _Comp __comp);
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void sort();
|
void sort();
|
||||||
template <class _Comp>
|
template <class _Comp>
|
||||||
@@ -1146,7 +1138,7 @@ list<_Tp, _Alloc>::list(size_type __n)
|
|||||||
__get_db()->__insert_c(this);
|
__get_db()->__insert_c(this);
|
||||||
#endif
|
#endif
|
||||||
for (; __n > 0; --__n)
|
for (; __n > 0; --__n)
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_CXX03_LANG
|
||||||
emplace_back();
|
emplace_back();
|
||||||
#else
|
#else
|
||||||
push_back(value_type());
|
push_back(value_type());
|
||||||
@@ -1161,11 +1153,7 @@ list<_Tp, _Alloc>::list(size_type __n, const allocator_type& __a) : base(__a)
|
|||||||
__get_db()->__insert_c(this);
|
__get_db()->__insert_c(this);
|
||||||
#endif
|
#endif
|
||||||
for (; __n > 0; --__n)
|
for (; __n > 0; --__n)
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
emplace_back();
|
emplace_back();
|
||||||
#else
|
|
||||||
push_back(value_type());
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1239,7 +1227,7 @@ list<_Tp, _Alloc>::list(const list& __c, const allocator_type& __a)
|
|||||||
push_back(*__i);
|
push_back(*__i);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
#ifndef _LIBCPP_CXX03_LANG
|
||||||
|
|
||||||
template <class _Tp, class _Alloc>
|
template <class _Tp, class _Alloc>
|
||||||
list<_Tp, _Alloc>::list(initializer_list<value_type> __il, const allocator_type& __a)
|
list<_Tp, _Alloc>::list(initializer_list<value_type> __il, const allocator_type& __a)
|
||||||
@@ -1264,23 +1252,6 @@ list<_Tp, _Alloc>::list(initializer_list<value_type> __il)
|
|||||||
push_back(*__i);
|
push_back(*__i);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
|
|
||||||
template <class _Tp, class _Alloc>
|
|
||||||
inline
|
|
||||||
list<_Tp, _Alloc>&
|
|
||||||
list<_Tp, _Alloc>::operator=(const list& __c)
|
|
||||||
{
|
|
||||||
if (this != &__c)
|
|
||||||
{
|
|
||||||
base::__copy_assign_alloc(__c);
|
|
||||||
assign(__c.begin(), __c.end());
|
|
||||||
}
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
|
|
||||||
template <class _Tp, class _Alloc>
|
template <class _Tp, class _Alloc>
|
||||||
inline
|
inline
|
||||||
list<_Tp, _Alloc>::list(list&& __c)
|
list<_Tp, _Alloc>::list(list&& __c)
|
||||||
@@ -1346,7 +1317,20 @@ list<_Tp, _Alloc>::__move_assign(list& __c, true_type)
|
|||||||
splice(end(), __c);
|
splice(end(), __c);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif // _LIBCPP_CXX03_LANG
|
||||||
|
|
||||||
|
template <class _Tp, class _Alloc>
|
||||||
|
inline
|
||||||
|
list<_Tp, _Alloc>&
|
||||||
|
list<_Tp, _Alloc>::operator=(const list& __c)
|
||||||
|
{
|
||||||
|
if (this != &__c)
|
||||||
|
{
|
||||||
|
base::__copy_assign_alloc(__c);
|
||||||
|
assign(__c.begin(), __c.end());
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
template <class _Tp, class _Alloc>
|
template <class _Tp, class _Alloc>
|
||||||
template <class _InpIter>
|
template <class _InpIter>
|
||||||
@@ -1576,7 +1560,7 @@ list<_Tp, _Alloc>::push_back(const value_type& __x)
|
|||||||
__hold.release();
|
__hold.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_CXX03_LANG
|
||||||
|
|
||||||
template <class _Tp, class _Alloc>
|
template <class _Tp, class _Alloc>
|
||||||
void
|
void
|
||||||
@@ -1604,8 +1588,6 @@ list<_Tp, _Alloc>::push_back(value_type&& __x)
|
|||||||
__hold.release();
|
__hold.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
|
||||||
|
|
||||||
template <class _Tp, class _Alloc>
|
template <class _Tp, class _Alloc>
|
||||||
template <class... _Args>
|
template <class... _Args>
|
||||||
#if _LIBCPP_STD_VER > 14
|
#if _LIBCPP_STD_VER > 14
|
||||||
@@ -1677,8 +1659,6 @@ list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
|
||||||
|
|
||||||
template <class _Tp, class _Alloc>
|
template <class _Tp, class _Alloc>
|
||||||
typename list<_Tp, _Alloc>::iterator
|
typename list<_Tp, _Alloc>::iterator
|
||||||
list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x)
|
list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x)
|
||||||
@@ -1704,7 +1684,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif // _LIBCPP_CXX03_LANG
|
||||||
|
|
||||||
template <class _Tp, class _Alloc>
|
template <class _Tp, class _Alloc>
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
// UNSUPPORTED: c++98, c++03
|
||||||
|
|
||||||
// <list>
|
// <list>
|
||||||
|
|
||||||
// void assign(initializer_list<value_type> il);
|
// void assign(initializer_list<value_type> il);
|
||||||
@@ -18,7 +20,6 @@
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
{
|
{
|
||||||
std::list<int> d;
|
std::list<int> d;
|
||||||
d.assign({3, 4, 5, 6});
|
d.assign({3, 4, 5, 6});
|
||||||
@@ -29,7 +30,6 @@ int main()
|
|||||||
assert(*i++ == 5);
|
assert(*i++ == 5);
|
||||||
assert(*i++ == 6);
|
assert(*i++ == 6);
|
||||||
}
|
}
|
||||||
#if TEST_STD_VER >= 11
|
|
||||||
{
|
{
|
||||||
std::list<int, min_allocator<int>> d;
|
std::list<int, min_allocator<int>> d;
|
||||||
d.assign({3, 4, 5, 6});
|
d.assign({3, 4, 5, 6});
|
||||||
@@ -40,6 +40,4 @@ int main()
|
|||||||
assert(*i++ == 5);
|
assert(*i++ == 5);
|
||||||
assert(*i++ == 6);
|
assert(*i++ == 6);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
// UNSUPPORTED: c++98, c++03
|
||||||
|
|
||||||
// <list>
|
// <list>
|
||||||
|
|
||||||
// list& operator=(list&& c);
|
// list& operator=(list&& c);
|
||||||
@@ -19,7 +21,6 @@
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
{
|
{
|
||||||
std::list<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
|
std::list<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
|
||||||
std::list<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
|
std::list<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
|
||||||
@@ -62,7 +63,6 @@ int main()
|
|||||||
assert(l.empty());
|
assert(l.empty());
|
||||||
assert(l2.get_allocator() == lo.get_allocator());
|
assert(l2.get_allocator() == lo.get_allocator());
|
||||||
}
|
}
|
||||||
#if TEST_STD_VER >= 11
|
|
||||||
{
|
{
|
||||||
std::list<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
|
std::list<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
|
||||||
std::list<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
|
std::list<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
|
||||||
@@ -77,6 +77,4 @@ int main()
|
|||||||
assert(l.empty());
|
assert(l.empty());
|
||||||
assert(l2.get_allocator() == lo.get_allocator());
|
assert(l2.get_allocator() == lo.get_allocator());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
// UNSUPPORTED: c++98, c++03
|
||||||
|
|
||||||
// <list>
|
// <list>
|
||||||
|
|
||||||
// list(initializer_list<value_type> il);
|
// list(initializer_list<value_type> il);
|
||||||
@@ -18,7 +20,6 @@
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
{
|
{
|
||||||
std::list<int> d = {3, 4, 5, 6};
|
std::list<int> d = {3, 4, 5, 6};
|
||||||
assert(d.size() == 4);
|
assert(d.size() == 4);
|
||||||
@@ -28,7 +29,6 @@ int main()
|
|||||||
assert(*i++ == 5);
|
assert(*i++ == 5);
|
||||||
assert(*i++ == 6);
|
assert(*i++ == 6);
|
||||||
}
|
}
|
||||||
#if TEST_STD_VER >= 11
|
|
||||||
{
|
{
|
||||||
std::list<int, min_allocator<int>> d = {3, 4, 5, 6};
|
std::list<int, min_allocator<int>> d = {3, 4, 5, 6};
|
||||||
assert(d.size() == 4);
|
assert(d.size() == 4);
|
||||||
@@ -38,6 +38,4 @@ int main()
|
|||||||
assert(*i++ == 5);
|
assert(*i++ == 5);
|
||||||
assert(*i++ == 6);
|
assert(*i++ == 6);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
// UNSUPPORTED: c++98, c++03
|
||||||
|
|
||||||
// <list>
|
// <list>
|
||||||
|
|
||||||
// list(initializer_list<value_type> il, const Allocator& a = allocator_type());
|
// list(initializer_list<value_type> il, const Allocator& a = allocator_type());
|
||||||
@@ -19,7 +21,6 @@
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
{
|
{
|
||||||
std::list<int, test_allocator<int>> d({3, 4, 5, 6}, test_allocator<int>(3));
|
std::list<int, test_allocator<int>> d({3, 4, 5, 6}, test_allocator<int>(3));
|
||||||
assert(d.get_allocator() == test_allocator<int>(3));
|
assert(d.get_allocator() == test_allocator<int>(3));
|
||||||
@@ -30,7 +31,6 @@ int main()
|
|||||||
assert(*i++ == 5);
|
assert(*i++ == 5);
|
||||||
assert(*i++ == 6);
|
assert(*i++ == 6);
|
||||||
}
|
}
|
||||||
#if TEST_STD_VER >= 11
|
|
||||||
{
|
{
|
||||||
std::list<int, min_allocator<int>> d({3, 4, 5, 6}, min_allocator<int>());
|
std::list<int, min_allocator<int>> d({3, 4, 5, 6}, min_allocator<int>());
|
||||||
assert(d.get_allocator() == min_allocator<int>());
|
assert(d.get_allocator() == min_allocator<int>());
|
||||||
@@ -41,6 +41,4 @@ int main()
|
|||||||
assert(*i++ == 5);
|
assert(*i++ == 5);
|
||||||
assert(*i++ == 6);
|
assert(*i++ == 6);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
// UNSUPPORTED: c++98, c++03
|
||||||
|
|
||||||
// <list>
|
// <list>
|
||||||
|
|
||||||
// list(list&& c, const allocator_type& a);
|
// list(list&& c, const allocator_type& a);
|
||||||
@@ -19,7 +21,6 @@
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
{
|
{
|
||||||
std::list<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
|
std::list<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
|
||||||
std::list<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
|
std::list<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
|
||||||
@@ -59,7 +60,6 @@ int main()
|
|||||||
assert(!l.empty());
|
assert(!l.empty());
|
||||||
assert(l2.get_allocator() == other_allocator<MoveOnly>(4));
|
assert(l2.get_allocator() == other_allocator<MoveOnly>(4));
|
||||||
}
|
}
|
||||||
#if TEST_STD_VER >= 11
|
|
||||||
{
|
{
|
||||||
std::list<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
|
std::list<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
|
||||||
std::list<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
|
std::list<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
|
||||||
@@ -73,6 +73,4 @@ int main()
|
|||||||
assert(l.empty());
|
assert(l.empty());
|
||||||
assert(l2.get_allocator() == min_allocator<MoveOnly>());
|
assert(l2.get_allocator() == min_allocator<MoveOnly>());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
// UNSUPPORTED: c++98, c++03
|
||||||
|
|
||||||
// <list>
|
// <list>
|
||||||
|
|
||||||
// list& operator=(initializer_list<value_type> il);
|
// list& operator=(initializer_list<value_type> il);
|
||||||
@@ -17,7 +19,6 @@
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
{
|
{
|
||||||
std::list<int> d;
|
std::list<int> d;
|
||||||
d = {3, 4, 5, 6};
|
d = {3, 4, 5, 6};
|
||||||
@@ -28,7 +29,6 @@ int main()
|
|||||||
assert(*i++ == 5);
|
assert(*i++ == 5);
|
||||||
assert(*i++ == 6);
|
assert(*i++ == 6);
|
||||||
}
|
}
|
||||||
#if TEST_STD_VER >= 11
|
|
||||||
{
|
{
|
||||||
std::list<int, min_allocator<int>> d;
|
std::list<int, min_allocator<int>> d;
|
||||||
d = {3, 4, 5, 6};
|
d = {3, 4, 5, 6};
|
||||||
@@ -39,6 +39,4 @@ int main()
|
|||||||
assert(*i++ == 5);
|
assert(*i++ == 5);
|
||||||
assert(*i++ == 6);
|
assert(*i++ == 6);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
// UNSUPPORTED: c++98, c++03
|
||||||
|
|
||||||
// <list>
|
// <list>
|
||||||
|
|
||||||
// iterator insert(const_iterator p, initializer_list<value_type> il);
|
// iterator insert(const_iterator p, initializer_list<value_type> il);
|
||||||
@@ -18,7 +20,6 @@
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
{
|
{
|
||||||
std::list<int> d(10, 1);
|
std::list<int> d(10, 1);
|
||||||
std::list<int>::iterator i = d.insert(next(d.cbegin(), 2), {3, 4, 5, 6});
|
std::list<int>::iterator i = d.insert(next(d.cbegin(), 2), {3, 4, 5, 6});
|
||||||
@@ -40,7 +41,6 @@ int main()
|
|||||||
assert(*i++ == 1);
|
assert(*i++ == 1);
|
||||||
assert(*i++ == 1);
|
assert(*i++ == 1);
|
||||||
}
|
}
|
||||||
#if TEST_STD_VER >= 11
|
|
||||||
{
|
{
|
||||||
std::list<int, min_allocator<int>> d(10, 1);
|
std::list<int, min_allocator<int>> d(10, 1);
|
||||||
std::list<int, min_allocator<int>>::iterator i = d.insert(next(d.cbegin(), 2), {3, 4, 5, 6});
|
std::list<int, min_allocator<int>>::iterator i = d.insert(next(d.cbegin(), 2), {3, 4, 5, 6});
|
||||||
@@ -62,6 +62,4 @@ int main()
|
|||||||
assert(*i++ == 1);
|
assert(*i++ == 1);
|
||||||
assert(*i++ == 1);
|
assert(*i++ == 1);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
// UNSUPPORTED: c++98, c++03
|
||||||
|
|
||||||
// <list>
|
// <list>
|
||||||
|
|
||||||
// void push_back(value_type&& x);
|
// void push_back(value_type&& x);
|
||||||
@@ -19,7 +21,6 @@
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
{
|
{
|
||||||
std::list<MoveOnly> l1;
|
std::list<MoveOnly> l1;
|
||||||
l1.push_back(MoveOnly(1));
|
l1.push_back(MoveOnly(1));
|
||||||
@@ -30,7 +31,6 @@ int main()
|
|||||||
assert(l1.front() == MoveOnly(1));
|
assert(l1.front() == MoveOnly(1));
|
||||||
assert(l1.back() == MoveOnly(2));
|
assert(l1.back() == MoveOnly(2));
|
||||||
}
|
}
|
||||||
#if TEST_STD_VER >= 11
|
|
||||||
{
|
{
|
||||||
std::list<MoveOnly, min_allocator<MoveOnly>> l1;
|
std::list<MoveOnly, min_allocator<MoveOnly>> l1;
|
||||||
l1.push_back(MoveOnly(1));
|
l1.push_back(MoveOnly(1));
|
||||||
@@ -41,6 +41,4 @@ int main()
|
|||||||
assert(l1.front() == MoveOnly(1));
|
assert(l1.front() == MoveOnly(1));
|
||||||
assert(l1.back() == MoveOnly(2));
|
assert(l1.back() == MoveOnly(2));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
// UNSUPPORTED: c++98, c++03
|
||||||
|
|
||||||
// <list>
|
// <list>
|
||||||
|
|
||||||
// void push_front(value_type&& x);
|
// void push_front(value_type&& x);
|
||||||
@@ -19,7 +21,6 @@
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
{
|
{
|
||||||
std::list<MoveOnly> l1;
|
std::list<MoveOnly> l1;
|
||||||
l1.push_front(MoveOnly(1));
|
l1.push_front(MoveOnly(1));
|
||||||
@@ -30,7 +31,6 @@ int main()
|
|||||||
assert(l1.front() == MoveOnly(2));
|
assert(l1.front() == MoveOnly(2));
|
||||||
assert(l1.back() == MoveOnly(1));
|
assert(l1.back() == MoveOnly(1));
|
||||||
}
|
}
|
||||||
#if TEST_STD_VER >= 11
|
|
||||||
{
|
{
|
||||||
std::list<MoveOnly, min_allocator<MoveOnly>> l1;
|
std::list<MoveOnly, min_allocator<MoveOnly>> l1;
|
||||||
l1.push_front(MoveOnly(1));
|
l1.push_front(MoveOnly(1));
|
||||||
@@ -41,6 +41,4 @@ int main()
|
|||||||
assert(l1.front() == MoveOnly(2));
|
assert(l1.front() == MoveOnly(2));
|
||||||
assert(l1.back() == MoveOnly(1));
|
assert(l1.back() == MoveOnly(1));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user