Merge branch 'develop'

This commit is contained in:
joaquintides 2023-03-01 11:04:04 +01:00
commit 1b61b05467
5 changed files with 73 additions and 29 deletions

View File

@ -1,4 +1,4 @@
/* Copyright 2003-2022 Joaquin M Lopez Munoz.
/* Copyright 2003-2023 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@ -47,7 +47,6 @@
#include <boost/core/no_exceptions_support.hpp>
#include <boost/core/ref.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/foreach_fwd.hpp>
#include <boost/iterator/reverse_iterator.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
@ -1725,16 +1724,22 @@ void swap(
/* Boost.Foreach compatibility */
namespace boost{
namespace foreach{
template<typename>
struct is_noncopyable;
template<
typename KeyFromValue,typename Compare,
typename SuperMeta,typename TagList,typename Category,typename AugmentPolicy
>
inline boost::mpl::true_* boost_foreach_is_noncopyable(
struct is_noncopyable<
boost::multi_index::detail::ordered_index<
KeyFromValue,Compare,SuperMeta,TagList,Category,AugmentPolicy>*&,
boost_foreach_argument_dependent_lookup_hack)
{
return 0;
KeyFromValue,Compare,SuperMeta,TagList,Category,AugmentPolicy>
>:boost::mpl::true_{};
}
}
#undef BOOST_MULTI_INDEX_ORD_INDEX_CHECK_INVARIANT

View File

@ -19,7 +19,6 @@
#include <boost/core/addressof.hpp>
#include <boost/core/no_exceptions_support.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/foreach_fwd.hpp>
#include <boost/limits.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
@ -1890,16 +1889,21 @@ struct hashed_non_unique
/* Boost.Foreach compatibility */
namespace boost{
namespace foreach{
template<typename>
struct is_noncopyable;
template<
typename KeyFromValue,typename Hash,typename Pred,
typename SuperMeta,typename TagList,typename Category
>
inline boost::mpl::true_* boost_foreach_is_noncopyable(
boost::multi_index::detail::hashed_index<
KeyFromValue,Hash,Pred,SuperMeta,TagList,Category>*&,
boost_foreach_argument_dependent_lookup_hack)
{
return 0;
struct is_noncopyable<boost::multi_index::detail::hashed_index<
KeyFromValue,Hash,Pred,SuperMeta,TagList,Category>
>:boost::mpl::true_{};
}
}
#undef BOOST_MULTI_INDEX_HASHED_INDEX_CHECK_INVARIANT

View File

@ -1,4 +1,4 @@
/* Copyright 2003-2021 Joaquin M Lopez Munoz.
/* Copyright 2003-2023 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@ -20,7 +20,6 @@
#include <boost/core/addressof.hpp>
#include <boost/core/no_exceptions_support.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/foreach_fwd.hpp>
#include <boost/iterator/reverse_iterator.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
@ -1343,12 +1342,18 @@ struct random_access
/* Boost.Foreach compatibility */
namespace boost{
namespace foreach{
template<typename>
struct is_noncopyable;
template<typename SuperMeta,typename TagList>
inline boost::mpl::true_* boost_foreach_is_noncopyable(
boost::multi_index::detail::random_access_index<SuperMeta,TagList>*&,
boost_foreach_argument_dependent_lookup_hack)
{
return 0;
struct is_noncopyable<
boost::multi_index::detail::random_access_index<SuperMeta,TagList>
>:boost::mpl::true_{};
}
}
#undef BOOST_MULTI_INDEX_RND_INDEX_CHECK_INVARIANT

View File

@ -1,4 +1,4 @@
/* Copyright 2003-2021 Joaquin M Lopez Munoz.
/* Copyright 2003-2023 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@ -19,7 +19,6 @@
#include <boost/core/addressof.hpp>
#include <boost/core/no_exceptions_support.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/foreach_fwd.hpp>
#include <boost/iterator/reverse_iterator.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
@ -1238,12 +1237,18 @@ struct sequenced
/* Boost.Foreach compatibility */
namespace boost{
namespace foreach{
template<typename>
struct is_noncopyable;
template<typename SuperMeta,typename TagList>
inline boost::mpl::true_* boost_foreach_is_noncopyable(
boost::multi_index::detail::sequenced_index<SuperMeta,TagList>*&,
boost_foreach_argument_dependent_lookup_hack)
{
return 0;
struct is_noncopyable<
boost::multi_index::detail::sequenced_index<SuperMeta,TagList>
>:boost::mpl::true_{};
}
}
#undef BOOST_MULTI_INDEX_SEQ_INDEX_CHECK_INVARIANT

View File

@ -1,6 +1,6 @@
/* Boost.MultiIndex test for iterators.
*
* Copyright 2003-2013 Joaquin M Lopez Munoz.
* Copyright 2003-2023 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@ -15,6 +15,7 @@
#include "employee.hpp"
#include <boost/detail/lightweight_test.hpp>
#include <boost/next_prior.hpp>
#include <boost/foreach.hpp>
using namespace boost::multi_index;
@ -223,6 +224,24 @@ void test_const_rnd_iterators(const Index& i,int target)
BOOST_TEST(n==target&&n==m&&n==p&&n==q);
}
template<typename Index>
void test_boost_for_each(const Index& i,int)
{
typedef typename Index::value_type value_type;
typedef typename Index::size_type size_type;
size_type size=i.size();
size_type count=0;
BOOST_FOREACH(value_type const& x, i)
{
(void)x;
++count;
}
BOOST_TEST_EQ(count, size);
}
void test_iterators()
{
employee_set es;
@ -237,14 +256,20 @@ void test_iterators()
test_non_const_iterators (es,target);
test_const_iterators (es,target);
test_boost_for_each (es,target);
test_non_const_hashed_iterators(get<1>(es),target);
test_const_hashed_iterators (get<1>(es),target);
test_boost_for_each (get<1>(es),target);
test_non_const_iterators (get<2>(es),target);
test_const_iterators (get<2>(es),target);
test_boost_for_each (get<2>(es),target);
test_non_const_iterators (get<3>(es),target);
test_const_iterators (get<3>(es),target);
test_boost_for_each (get<3>(es),target);
test_non_const_hashed_iterators(get<4>(es),target);
test_const_hashed_iterators (get<4>(es),target);
test_boost_for_each (get<4>(es),target);
test_non_const_rnd_iterators (get<5>(es),target);
test_const_rnd_iterators (get<5>(es),target);
test_boost_for_each (get<5>(es),target);
}