mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 19:37:14 +02:00
Remove use of operator&.
Also reactivate operator& for minimal test classes. Apparently I disabled them because of a problem in a type trait, but I'm not seeing that now. Maybe it will appear on other compilers.
This commit is contained in:
@ -223,7 +223,7 @@ namespace boost { namespace unordered { namespace iterator_detail {
|
|||||||
}
|
}
|
||||||
|
|
||||||
value_type* operator->() const {
|
value_type* operator->() const {
|
||||||
return &node_->value();
|
return node_->value_ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
iterator& operator++() {
|
iterator& operator++() {
|
||||||
@ -287,7 +287,7 @@ namespace boost { namespace unordered { namespace iterator_detail {
|
|||||||
}
|
}
|
||||||
|
|
||||||
value_type const* operator->() const {
|
value_type const* operator->() const {
|
||||||
return &node_->value();
|
return node_->value_ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
c_iterator& operator++() {
|
c_iterator& operator++() {
|
||||||
|
@ -48,6 +48,7 @@ namespace minimal
|
|||||||
public:
|
public:
|
||||||
destructible(constructor_param const&) {}
|
destructible(constructor_param const&) {}
|
||||||
~destructible() {}
|
~destructible() {}
|
||||||
|
void dummy_member() const {}
|
||||||
private:
|
private:
|
||||||
destructible(destructible const&);
|
destructible(destructible const&);
|
||||||
destructible& operator=(destructible const&);
|
destructible& operator=(destructible const&);
|
||||||
@ -59,6 +60,7 @@ namespace minimal
|
|||||||
copy_constructible(constructor_param const&) {}
|
copy_constructible(constructor_param const&) {}
|
||||||
copy_constructible(copy_constructible const&) {}
|
copy_constructible(copy_constructible const&) {}
|
||||||
~copy_constructible() {}
|
~copy_constructible() {}
|
||||||
|
void dummy_member() const {}
|
||||||
private:
|
private:
|
||||||
copy_constructible& operator=(copy_constructible const&);
|
copy_constructible& operator=(copy_constructible const&);
|
||||||
copy_constructible() {}
|
copy_constructible() {}
|
||||||
@ -78,6 +80,7 @@ namespace minimal
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dummy_member() const {}
|
||||||
private:
|
private:
|
||||||
copy_constructible_equality_comparable& operator=(
|
copy_constructible_equality_comparable& operator=(
|
||||||
copy_constructible_equality_comparable const&);
|
copy_constructible_equality_comparable const&);
|
||||||
@ -121,6 +124,7 @@ namespace minimal
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dummy_member() const {}
|
||||||
private:
|
private:
|
||||||
ampersand_operator_used operator&() const {
|
ampersand_operator_used operator&() const {
|
||||||
return ampersand_operator_used(); }
|
return ampersand_operator_used(); }
|
||||||
@ -133,11 +137,10 @@ namespace minimal
|
|||||||
assignable(assignable const&) {}
|
assignable(assignable const&) {}
|
||||||
assignable& operator=(assignable const&) { return *this; }
|
assignable& operator=(assignable const&) { return *this; }
|
||||||
~assignable() {}
|
~assignable() {}
|
||||||
|
void dummy_member() const {}
|
||||||
private:
|
private:
|
||||||
assignable() {}
|
assignable() {}
|
||||||
// TODO: This messes up a concept check in the tests.
|
ampersand_operator_used operator&() const { return ampersand_operator_used(); }
|
||||||
//ampersand_operator_used operator&() const { return ampersand_operator_used(); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct movable_init {};
|
struct movable_init {};
|
||||||
@ -153,6 +156,7 @@ namespace minimal
|
|||||||
movable1(BOOST_RV_REF(movable1)) {}
|
movable1(BOOST_RV_REF(movable1)) {}
|
||||||
movable1& operator=(BOOST_RV_REF(movable1)) { return *this; }
|
movable1& operator=(BOOST_RV_REF(movable1)) { return *this; }
|
||||||
~movable1() {}
|
~movable1() {}
|
||||||
|
void dummy_member() const {}
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||||
@ -164,6 +168,7 @@ namespace minimal
|
|||||||
movable2(movable2&&) {}
|
movable2(movable2&&) {}
|
||||||
~movable2() {}
|
~movable2() {}
|
||||||
movable2& operator=(movable2&&) { return *this; }
|
movable2& operator=(movable2&&) { return *this; }
|
||||||
|
void dummy_member() const {}
|
||||||
private:
|
private:
|
||||||
movable2() {}
|
movable2() {}
|
||||||
movable2(movable2 const&);
|
movable2(movable2 const&);
|
||||||
@ -289,8 +294,7 @@ namespace minimal
|
|||||||
bool operator<=(ptr const& x) const { return ptr_ <= x.ptr_; }
|
bool operator<=(ptr const& x) const { return ptr_ <= x.ptr_; }
|
||||||
bool operator>=(ptr const& x) const { return ptr_ >= x.ptr_; }
|
bool operator>=(ptr const& x) const { return ptr_ >= x.ptr_; }
|
||||||
private:
|
private:
|
||||||
// TODO:
|
ampersand_operator_used operator&() const { return ampersand_operator_used(); }
|
||||||
//ampersand_operator_used operator&() const { return ampersand_operator_used(); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
@ -326,8 +330,7 @@ namespace minimal
|
|||||||
bool operator<=(const_ptr const& x) const { return ptr_ <= x.ptr_; }
|
bool operator<=(const_ptr const& x) const { return ptr_ <= x.ptr_; }
|
||||||
bool operator>=(const_ptr const& x) const { return ptr_ >= x.ptr_; }
|
bool operator>=(const_ptr const& x) const { return ptr_ >= x.ptr_; }
|
||||||
private:
|
private:
|
||||||
// TODO:
|
ampersand_operator_used operator&() const { return ampersand_operator_used(); }
|
||||||
//ampersand_operator_used operator&() const { return ampersand_operator_used(); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
|
@ -202,6 +202,7 @@ UNORDERED_AUTO_TEST(test2)
|
|||||||
unordered_unique_test(map, map_value);
|
unordered_unique_test(map, map_value);
|
||||||
unordered_map_test(map, assignable, assignable);
|
unordered_map_test(map, assignable, assignable);
|
||||||
unordered_copyable_test(map, assignable, map_value, hash, equal_to);
|
unordered_copyable_test(map, assignable, map_value, hash, equal_to);
|
||||||
|
unordered_map_member_test(map, map_value);
|
||||||
|
|
||||||
boost::unordered_map<
|
boost::unordered_map<
|
||||||
test::minimal::assignable,
|
test::minimal::assignable,
|
||||||
@ -226,6 +227,7 @@ UNORDERED_AUTO_TEST(test2)
|
|||||||
unordered_equivalent_test(multimap, map_value);
|
unordered_equivalent_test(multimap, map_value);
|
||||||
unordered_map_test(multimap, assignable, assignable);
|
unordered_map_test(multimap, assignable, assignable);
|
||||||
unordered_copyable_test(multimap, assignable, map_value, hash, equal_to);
|
unordered_copyable_test(multimap, assignable, map_value, hash, equal_to);
|
||||||
|
unordered_map_member_test(multimap, map_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
RUN_TESTS()
|
RUN_TESTS()
|
||||||
|
@ -183,6 +183,7 @@ UNORDERED_AUTO_TEST(test2)
|
|||||||
unordered_unique_test(set, assignable);
|
unordered_unique_test(set, assignable);
|
||||||
unordered_set_test(set, assignable);
|
unordered_set_test(set, assignable);
|
||||||
unordered_copyable_test(set, assignable, assignable, hash, equal_to);
|
unordered_copyable_test(set, assignable, assignable, hash, equal_to);
|
||||||
|
unordered_set_member_test(set, assignable);
|
||||||
|
|
||||||
std::cout<<"Test unordered_multiset.\n";
|
std::cout<<"Test unordered_multiset.\n";
|
||||||
|
|
||||||
@ -195,6 +196,7 @@ UNORDERED_AUTO_TEST(test2)
|
|||||||
unordered_equivalent_test(multiset, assignable);
|
unordered_equivalent_test(multiset, assignable);
|
||||||
unordered_set_test(multiset, assignable);
|
unordered_set_test(multiset, assignable);
|
||||||
unordered_copyable_test(multiset, assignable, assignable, hash, equal_to);
|
unordered_copyable_test(multiset, assignable, assignable, hash, equal_to);
|
||||||
|
unordered_set_member_test(multiset, assignable);
|
||||||
}
|
}
|
||||||
|
|
||||||
UNORDERED_AUTO_TEST(movable1_tests)
|
UNORDERED_AUTO_TEST(movable1_tests)
|
||||||
|
@ -554,3 +554,23 @@ void unordered_movable_test(X& x, Key& k, T& /* t */, Hash& hf, Pred& eq)
|
|||||||
sink(a8);
|
sink(a8);
|
||||||
sink(a10);
|
sink(a10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class X, class T>
|
||||||
|
void unordered_set_member_test(X& x, T& t)
|
||||||
|
{
|
||||||
|
X x1(x);
|
||||||
|
x1.insert(t);
|
||||||
|
x1.begin()->dummy_member();
|
||||||
|
x1.cbegin()->dummy_member();
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class X, class T>
|
||||||
|
void unordered_map_member_test(X& x, T& t)
|
||||||
|
{
|
||||||
|
X x1(x);
|
||||||
|
x1.insert(t);
|
||||||
|
x1.begin()->first.dummy_member();
|
||||||
|
x1.cbegin()->first.dummy_member();
|
||||||
|
x1.begin()->second.dummy_member();
|
||||||
|
x1.cbegin()->second.dummy_member();
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user