Remove BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY

Correct static_assert messages.
Fix messages & replace is_standard_layout with is_copy_constructible.
This commit is contained in:
Georgy Guminov
2024-10-26 15:06:43 +03:00
parent c69ac1408a
commit fdfafce2b9
4 changed files with 8 additions and 26 deletions

View File

@ -433,9 +433,7 @@ namespace iterators {
struct use_operator_brackets_proxy
: detail::negation<
detail::conjunction<
// Really we want an is_copy_constructible trait here,
// but is_POD will have to suffice in the meantime.
std::is_standard_layout<ValueType>
std::is_copy_constructible<ValueType>
, std::is_trivial<ValueType>
, iterator_writability_disabled<ValueType,Reference>
>
@ -908,11 +906,6 @@ namespace iterators {
# define BOOST_ITERATOR_FACADE_INTEROP(op, result_type, return_prefix, base_op) \
BOOST_ITERATOR_FACADE_INTEROP_HEAD(inline, op, result_type) \
{ \
/* For those compilers that do not support enable_if */ \
static_assert( \
is_interoperable<Derived1, Derived2>::value, \
"Derived1 & Derived2 types must be interoperable." \
); \
return_prefix iterator_core_access::base_op( \
*static_cast<Derived1 const*>(&lhs) \
, *static_cast<Derived2 const*>(&rhs) \
@ -938,16 +931,6 @@ namespace iterators {
BOOST_ITERATOR_FACADE_INTEROP_RANDOM_ACCESS_HEAD(inline, op, result_type) \
{ \
using boost::iterators::detail::is_traversal_at_least; \
typedef typename iterator_category<Derived1>::type Derived1IterCat; \
typedef typename iterator_category<Derived2>::type Derived2IterCat; \
/* For those compilers that do not support enable_if */ \
static_assert( \
is_interoperable<Derived1, Derived2>::value && \
is_traversal_at_least<Derived1IterCat, random_access_traversal_tag>::value && \
is_traversal_at_least<Derived2IterCat, random_access_traversal_tag>::value, \
"Derived1 & Derived2 types must be interoperable and must both have " \
"random_access_traversal_tag." \
); \
return_prefix iterator_core_access::base_op( \
*static_cast<Derived1 const*>(&lhs) \
, *static_cast<Derived2 const*>(&rhs) \

View File

@ -44,7 +44,7 @@ struct minimum_category_impl<true,true>
{
static_assert(
std::is_same<T1,T2>::value,
"Types must be same when they are convertible to each other."
"Iterator category types must be the same when they are equivalent."
);
typedef T1 type;
};

View File

@ -123,10 +123,9 @@ void constant_lvalue_iterator_test(Iterator i, T v1) {
const T &v2 = *i2;
BOOST_TEST(v1 == v2);
#ifndef BOOST_NO_LVALUE_RETURN_DETECTION
static_assert(is_lvalue_iterator<Iterator>::value,
"Iterator must be lvalue.");
static_assert(!is_non_const_lvalue_iterator<Iterator>::value,
"Iterator must be const.");
static_assert(is_lvalue_iterator<Iterator>::value
&& !is_non_const_lvalue_iterator<Iterator>::value,
"Iterator must be a const lvalue iterator.");
#endif
}
@ -149,7 +148,7 @@ void non_const_lvalue_iterator_test(Iterator i, T v1, T v2) {
BOOST_TEST(v2 == v4);
#ifndef BOOST_NO_LVALUE_RETURN_DETECTION
static_assert(is_lvalue_iterator<Iterator>::value,
"Iterator must be lvalue.");
"Iterator must be an lvalue iterator.");
static_assert(is_non_const_lvalue_iterator<Iterator>::value,
"Iterator must be non-const.");
#endif

View File

@ -40,7 +40,7 @@ int main()
static_assert(std::is_convertible<Iter::iterator_category,
std::random_access_iterator_tag>::value,
"Iter must have an STL random_access_iterator_tag.");
"Iter must have a random access category.");
static_assert(std::is_convertible<boost::iterator_traversal<Iter>::type,
boost::random_access_traversal_tag>::value,
"Iter must have a random_access_traversal_tag.");
@ -73,7 +73,7 @@ int main()
static_assert(std::is_convertible<Iter::iterator_category,
std::random_access_iterator_tag>::value,
"Iter must have an STL random_access_iterator_tag.");
"Iter must have a random access category.");
static_assert(std::is_convertible<boost::iterator_traversal<Iter>::type,
boost::random_access_traversal_tag>::value,
"Iter must have a random_access_traversal_tag.");