explicit unordered_set(const allocator_type& __a);
unordered_set(const unordered_set& __u);
unordered_set(const unordered_set& __u, const allocator_type& __a);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
unordered_set(unordered_set&& __u)
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
unordered_set(unordered_set&& __u, const allocator_type& __a);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
unordered_set(initializer_list<value_type> __il);
unordered_set(initializer_list<value_type> __il, size_type __n,
const hasher& __hf = hasher(),
const hasher& __hf, const allocator_type& __a)
: unordered_set(__il, __n, __hf, key_equal(), __a) {}
#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
// ~unordered_set() = default;
_LIBCPP_INLINE_VISIBILITY
unordered_set& operator=(const unordered_set& __u)
__table_ = __u.__table_;
return *this;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
unordered_set& operator=(unordered_set&& __u)
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
-#endif
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
_LIBCPP_INLINE_VISIBILITY
unordered_set& operator=(initializer_list<value_type> __il);
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const _NOEXCEPT
_LIBCPP_INLINE_VISIBILITY
const_iterator cend() const _NOEXCEPT {return __table_.end();}
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
+#ifndef _LIBCPP_CXX03_LANG
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> emplace(_Args&&... __args)
iterator emplace_hint(const_iterator, _Args&&... __args)
{return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...).first;}
#endif
-#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
- _LIBCPP_INLINE_VISIBILITY
- pair<iterator, bool> insert(const value_type& __x)
- {return __table_.__insert_unique(__x);}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> insert(value_type&& __x)
{return __table_.__insert_unique(_VSTD::move(__x));}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
#if _LIBCPP_DEBUG_LEVEL >= 2
- iterator insert(const_iterator __p, const value_type& __x)
+ iterator insert(const_iterator __p, value_type&& __x)
{
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
- "unordered_set::insert(const_iterator, const value_type&) called with an iterator not"
+ "unordered_set::insert(const_iterator, value_type&&) called with an iterator not"
" referring to this unordered_set");
- return insert(__x).first;
+ return insert(_VSTD::move(__x)).first;
}
#else
- iterator insert(const_iterator, const value_type& __x)
- {return insert(__x).first;}
+ iterator insert(const_iterator, value_type&& __x)
+ {return insert(_VSTD::move(__x)).first;}
#endif
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
+ void insert(initializer_list<value_type> __il)
+ {insert(__il.begin(), __il.end());}
+#endif // _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool> insert(const value_type& __x)
+ {return __table_.__insert_unique(__x);}
+
_LIBCPP_INLINE_VISIBILITY
#if _LIBCPP_DEBUG_LEVEL >= 2
- iterator insert(const_iterator __p, value_type&& __x)
+ iterator insert(const_iterator __p, const value_type& __x)
{
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
- "unordered_set::insert(const_iterator, value_type&&) called with an iterator not"
+ "unordered_set::insert(const_iterator, const value_type&) called with an iterator not"
" referring to this unordered_set");
- return insert(_VSTD::move(__x)).first;
+ return insert(__x).first;
}
#else
- iterator insert(const_iterator, value_type&& __x)
- {return insert(_VSTD::move(__x)).first;}
+ iterator insert(const_iterator, const value_type& __x)
+ {return insert(__x).first;}
#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
void insert(_InputIterator __first, _InputIterator __last);
-#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
iterator erase(const_iterator __p) {return __table_.erase(__p);}
insert(__u.begin(), __u.end());
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Value, class _Hash, class _Pred, class _Alloc>
inline
#endif
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
template <class _Value, class _Hash, class _Pred, class _Alloc>
unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
initializer_list<value_type> __il)
insert(__il.begin(), __il.end());
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Value, class _Hash, class _Pred, class _Alloc>
inline
unordered_set<_Value, _Hash, _Pred, _Alloc>&
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
template <class _Value, class _Hash, class _Pred, class _Alloc>
inline
unordered_set<_Value, _Hash, _Pred, _Alloc>&
return *this;
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
template <class _Value, class _Hash, class _Pred, class _Alloc>
template <class _InputIterator>
explicit unordered_multiset(const allocator_type& __a);
unordered_multiset(const unordered_multiset& __u);
unordered_multiset(const unordered_multiset& __u, const allocator_type& __a);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
unordered_multiset(unordered_multiset&& __u)
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
unordered_multiset(unordered_multiset&& __u, const allocator_type& __a);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
unordered_multiset(initializer_list<value_type> __il);
unordered_multiset(initializer_list<value_type> __il, size_type __n,
const hasher& __hf = hasher(),
unordered_multiset(initializer_list<value_type> __il, size_type __n, const hasher& __hf, const allocator_type& __a)
: unordered_multiset(__il, __n, __hf, key_equal(), __a) {}
#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
// ~unordered_multiset() = default;
_LIBCPP_INLINE_VISIBILITY
unordered_multiset& operator=(const unordered_multiset& __u)
__table_ = __u.__table_;
return *this;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
unordered_multiset& operator=(unordered_multiset&& __u)
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
-#endif
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
unordered_multiset& operator=(initializer_list<value_type> __il);
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const _NOEXCEPT
_LIBCPP_INLINE_VISIBILITY
const_iterator cend() const _NOEXCEPT {return __table_.end();}
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
+#ifndef _LIBCPP_CXX03_LANG
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
iterator emplace(_Args&&... __args)
_LIBCPP_INLINE_VISIBILITY
iterator emplace_hint(const_iterator __p, _Args&&... __args)
{return __table_.__emplace_hint_multi(__p, _VSTD::forward<_Args>(__args)...);}
-#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
- _LIBCPP_INLINE_VISIBILITY
- iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
_LIBCPP_INLINE_VISIBILITY
iterator insert(value_type&& __x) {return __table_.__insert_multi(_VSTD::move(__x));}
-#endif
- _LIBCPP_INLINE_VISIBILITY
- iterator insert(const_iterator __p, const value_type& __x)
- {return __table_.__insert_multi(__p, __x);}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __p, value_type&& __x)
{return __table_.__insert_multi(__p, _VSTD::move(__x));}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- template <class _InputIterator>
- _LIBCPP_INLINE_VISIBILITY
- void insert(_InputIterator __first, _InputIterator __last);
-#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
+#endif // _LIBCPP_CXX03_LANG
+
+ _LIBCPP_INLINE_VISIBILITY
+ iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
+
+ _LIBCPP_INLINE_VISIBILITY
+ iterator insert(const_iterator __p, const value_type& __x)
+ {return __table_.__insert_multi(__p, __x);}
+
+ template <class _InputIterator>
+ _LIBCPP_INLINE_VISIBILITY
+ void insert(_InputIterator __first, _InputIterator __last);
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __table_.erase(__p);}
insert(__u.begin(), __u.end());
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Value, class _Hash, class _Pred, class _Alloc>
inline
#endif
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
template <class _Value, class _Hash, class _Pred, class _Alloc>
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
initializer_list<value_type> __il)
insert(__il.begin(), __il.end());
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Value, class _Hash, class _Pred, class _Alloc>
inline
unordered_multiset<_Value, _Hash, _Pred, _Alloc>&
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
template <class _Value, class _Hash, class _Pred, class _Alloc>
inline
unordered_multiset<_Value, _Hash, _Pred, _Alloc>&
return *this;
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
template <class _Value, class _Hash, class _Pred, class _Alloc>
template <class _InputIterator>
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::unordered_multiset<Emplaceable> C;
typedef C::iterator R;
assert(c.size() == 3);
assert(*r == Emplaceable(5, 6));
}
-#if TEST_STD_VER >= 11
{
typedef std::unordered_multiset<Emplaceable, std::hash<Emplaceable>,
std::equal_to<Emplaceable>, min_allocator<Emplaceable>> C;
assert(c.size() == 3);
assert(*r == Emplaceable(5, 6));
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
// template <class... Args>
// iterator emplace_hint(const_iterator p, Args&&... args);
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
#include <unordered_set>
#include <cassert>
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::unordered_multiset<Emplaceable> C;
typedef C::iterator R;
assert(c.size() == 3);
assert(*r == Emplaceable(5, 6));
}
-#if TEST_STD_VER >= 11
{
typedef std::unordered_multiset<Emplaceable, std::hash<Emplaceable>,
std::equal_to<Emplaceable>, min_allocator<Emplaceable>> C;
assert(c.size() == 3);
assert(*r == Emplaceable(5, 6));
}
-#endif
-#if _LIBCPP_DEBUG >= 1
- {
- typedef std::unordered_multiset<Emplaceable> C;
- typedef C::iterator R;
- C c1;
- C c2;
- R r = c1.emplace_hint(c2.begin(), 5, 6);
- assert(false);
- }
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
// iterator insert(const_iterator p, value_type&& x);
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "min_allocator.h"
assert(c.size() == 4);
assert(*r == 5.5);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
typedef std::unordered_multiset<MoveOnly> C;
typedef C::iterator R;
assert(c.size() == 4);
assert(*r == 5);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#if TEST_STD_VER >= 11
{
typedef std::unordered_multiset<double, std::hash<double>,
std::equal_to<double>, min_allocator<double>> C;
assert(c.size() == 4);
assert(*r == 5.5);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, min_allocator<MoveOnly>> C;
assert(c.size() == 4);
assert(*r == 5);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#if _LIBCPP_DEBUG >= 1
- {
- typedef std::unordered_multiset<double> C;
- typedef C::iterator R;
- typedef C::value_type P;
- C c;
- C c2;
- C::const_iterator e = c2.end();
- R r = c.insert(e, P(3.5));
- assert(false);
- }
-#endif
-#endif
+#endif // TEST_STD_VER >= 11
}
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
typedef std::unordered_multiset<int> C;
typedef int P;
assert(c.count(3) == 1);
assert(c.count(4) == 1);
}
-#if TEST_STD_VER >= 11
{
typedef std::unordered_multiset<int, std::hash<int>,
std::equal_to<int>, min_allocator<int>> C;
assert(c.count(3) == 1);
assert(c.count(4) == 1);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "min_allocator.h"
assert(c.size() == 4);
assert(*r == 5.5);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
typedef std::unordered_multiset<MoveOnly> C;
typedef C::iterator R;
assert(c.size() == 4);
assert(*r == 5);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#if TEST_STD_VER >= 11
{
typedef std::unordered_multiset<double, std::hash<double>,
std::equal_to<double>, min_allocator<double>> C;
assert(c.size() == 4);
assert(*r == 5.5);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, min_allocator<MoveOnly>> C;
assert(c.size() == 4);
assert(*r == 5);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#endif
+#endif // TEST_STD_VER >= 11
}
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
typedef test_allocator<int> A;
typedef std::unordered_multiset<int,
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if TEST_STD_VER >= 11
{
typedef min_allocator<int> A;
typedef std::unordered_multiset<int,
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef test_allocator<int> A;
typedef std::unordered_multiset<int,
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if TEST_STD_VER >= 11
{
typedef test_allocator<int> A;
typedef std::unordered_multiset<int,
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#endif
-#if _LIBCPP_DEBUG >= 1
- {
- std::unordered_multiset<int> s1 = {1, 2, 3};
- std::unordered_multiset<int>::iterator i = s1.begin();
- int k = *i;
- std::unordered_multiset<int> s2;
- s2 = std::move(s1);
- assert(*i == k);
- s2.erase(i);
- assert(s2.size() == 2);
- }
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
typedef std::unordered_multiset<int,
test_hash<std::hash<int> >,
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if TEST_STD_VER >= 11
{
typedef std::unordered_multiset<int,
test_hash<std::hash<int> >,
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#endif
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // TEST_STD_VER > 11
}
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
typedef std::unordered_multiset<int,
test_hash<std::hash<int> >,
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if TEST_STD_VER >= 11
{
typedef std::unordered_multiset<int,
test_hash<std::hash<int> >,
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
typedef std::unordered_multiset<int,
test_hash<std::hash<int> >,
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if TEST_STD_VER >= 11
{
typedef std::unordered_multiset<int,
test_hash<std::hash<int> >,
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
typedef std::unordered_multiset<int,
test_hash<std::hash<int> >,
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if TEST_STD_VER >= 11
{
typedef std::unordered_multiset<int,
test_hash<std::hash<int> >,
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
typedef std::unordered_multiset<int,
test_hash<std::hash<int> >,
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if TEST_STD_VER >= 11
{
typedef std::unordered_multiset<int,
test_hash<std::hash<int> >,
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef int P;
typedef test_allocator<int> A;
assert(c0.empty());
}
-#if TEST_STD_VER >= 11
{
typedef int P;
typedef min_allocator<int> A;
assert(c0.empty());
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::unordered_set<Emplaceable> C;
typedef std::pair<C::iterator, bool> R;
assert(*r.first == Emplaceable(5, 6));
assert(!r.second);
}
-#if TEST_STD_VER >= 11
{
typedef std::unordered_set<Emplaceable, std::hash<Emplaceable>,
std::equal_to<Emplaceable>, min_allocator<Emplaceable>> C;
assert(*r.first == Emplaceable(5, 6));
assert(!r.second);
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
// template <class... Args>
// iterator emplace_hint(const_iterator p, Args&&... args);
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
#include <unordered_set>
#include <cassert>
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::unordered_set<Emplaceable> C;
typedef C::iterator R;
assert(c.size() == 2);
assert(*r == Emplaceable(5, 6));
}
-#if TEST_STD_VER >= 11
{
typedef std::unordered_set<Emplaceable, std::hash<Emplaceable>,
std::equal_to<Emplaceable>, min_allocator<Emplaceable>> C;
assert(c.size() == 2);
assert(*r == Emplaceable(5, 6));
}
-#endif
-#if _LIBCPP_DEBUG >= 1
- {
- typedef std::unordered_set<Emplaceable> C;
- typedef C::iterator R;
- C c1;
- C c2;
- R r = c1.emplace_hint(c2.begin(), 5, 6);
- assert(false);
- }
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
// iterator insert(const_iterator p, value_type&& x);
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "min_allocator.h"
assert(c.size() == 3);
assert(*r == 5.5);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
typedef std::unordered_set<MoveOnly> C;
typedef C::iterator R;
assert(c.size() == 3);
assert(*r == 5);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#if TEST_STD_VER >= 11
{
typedef std::unordered_set<double, std::hash<double>,
std::equal_to<double>, min_allocator<double>> C;
assert(c.size() == 3);
assert(*r == 5.5);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, min_allocator<MoveOnly>> C;
assert(c.size() == 3);
assert(*r == 5);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#if _LIBCPP_DEBUG >= 1
- {
- typedef std::unordered_set<double> C;
- typedef C::iterator R;
- typedef C::value_type P;
- C c;
- C c2;
- C::const_iterator e = c2.end();
- R r = c.insert(e, P(3.5));
- assert(false);
- }
-#endif
-#endif
+#endif // TEST_STD_VER >= 11
}
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
typedef std::unordered_set<int> C;
typedef int P;
assert(c.count(3) == 1);
assert(c.count(4) == 1);
}
-#if TEST_STD_VER >= 11
{
typedef std::unordered_set<int, std::hash<int>,
std::equal_to<int>, min_allocator<int>> C;
assert(c.count(3) == 1);
assert(c.count(4) == 1);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "min_allocator.h"
assert(*r.first == 5.5);
assert(r.second);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
typedef std::unordered_set<MoveOnly> C;
typedef std::pair<C::iterator, bool> R;
assert(*r.first == 5);
assert(r.second);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#if TEST_STD_VER >= 11
{
typedef std::unordered_set<double, std::hash<double>,
std::equal_to<double>, min_allocator<double>> C;
assert(*r.first == 5.5);
assert(r.second);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, min_allocator<MoveOnly>> C;
assert(*r.first == 5);
assert(r.second);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#endif
+#endif // TEST_STD_VER >= 11
}
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
typedef test_allocator<int> A;
typedef std::unordered_set<int,
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if TEST_STD_VER >= 11
{
typedef min_allocator<int> A;
typedef std::unordered_set<int,
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef test_allocator<int> A;
typedef std::unordered_set<int,
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if TEST_STD_VER >= 11
{
typedef min_allocator<int> A;
typedef std::unordered_set<int,
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#endif
-#if _LIBCPP_DEBUG >= 1
- {
- std::unordered_set<int> s1 = {1, 2, 3};
- std::unordered_set<int>::iterator i = s1.begin();
- int k = *i;
- std::unordered_set<int> s2;
- s2 = std::move(s1);
- assert(*i == k);
- s2.erase(i);
- assert(s2.size() == 2);
- }
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
- {
+ {
typedef std::unordered_set<int,
test_hash<std::hash<int> >,
test_compare<std::equal_to<int> >,
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if TEST_STD_VER >= 11
{
typedef std::unordered_set<int,
test_hash<std::hash<int> >,
assert(c.max_load_factor() == 1);
}
#endif
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
typedef std::unordered_set<int,
test_hash<std::hash<int> >,
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if TEST_STD_VER >= 11
{
typedef std::unordered_set<int,
test_hash<std::hash<int> >,
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
typedef std::unordered_set<int,
test_hash<std::hash<int> >,
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if TEST_STD_VER >= 11
{
typedef std::unordered_set<int,
test_hash<std::hash<int> >,
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
typedef std::unordered_set<int,
test_hash<std::hash<int> >,
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if TEST_STD_VER >= 11
{
typedef std::unordered_set<int,
test_hash<std::hash<int> >,
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
typedef std::unordered_set<int,
test_hash<std::hash<int> >,
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if TEST_STD_VER >= 11
{
typedef std::unordered_set<int,
test_hash<std::hash<int> >,
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef int P;
typedef test_allocator<int> A;
assert(c0.empty());
}
-#if TEST_STD_VER >= 11
{
typedef int P;
typedef min_allocator<int> A;
assert(c0.empty());
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}