mirror of
https://github.com/boostorg/container.git
synced 2025-07-30 04:27:17 +02:00
Fixes #250 ("Custom container leads to "invalid use of incomplete type" for "struct boost::container::dtl::container_rebind"")
This commit is contained in:
@ -1421,6 +1421,13 @@ use [*Boost.Container]? There are several reasons for that:
|
|||||||
|
|
||||||
[section:release_notes Release Notes]
|
[section:release_notes Release Notes]
|
||||||
|
|
||||||
|
[section:release_notes_boost_1_89_00 Boost 1.89 Release]
|
||||||
|
|
||||||
|
* Fixed bugs/issues:
|
||||||
|
* [@https://github.com/boostorg/container/issues/250 GitHub #250: ['"Custom container leads to invalid use of incomplete type for struct boost::container::dtl::container_rebind"]].
|
||||||
|
|
||||||
|
[endsect]
|
||||||
|
|
||||||
[section:release_notes_boost_1_88_00 Boost 1.88 Release]
|
[section:release_notes_boost_1_88_00 Boost 1.88 Release]
|
||||||
|
|
||||||
* Fixed bugs/issues:
|
* Fixed bugs/issues:
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
#include <boost/container/detail/type_traits.hpp>
|
#include <boost/container/detail/type_traits.hpp>
|
||||||
#include <boost/container/detail/mpl.hpp>
|
#include <boost/container/detail/mpl.hpp>
|
||||||
#include <boost/container/detail/algorithm.hpp> //equal()
|
#include <boost/container/detail/algorithm.hpp> //equal()
|
||||||
#include <boost/container/detail/container_or_allocator_rebind.hpp>
|
|
||||||
#include <boost/container/detail/pair.hpp>
|
#include <boost/container/detail/pair.hpp>
|
||||||
// move
|
// move
|
||||||
#include <boost/move/utility_core.hpp>
|
#include <boost/move/utility_core.hpp>
|
||||||
@ -54,6 +53,10 @@
|
|||||||
#define BOOST_CONTAINER_STD_PAIR_IS_MOVABLE
|
#define BOOST_CONTAINER_STD_PAIR_IS_MOVABLE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef BOOST_CONTAINER_STD_PAIR_IS_MOVABLE
|
||||||
|
#include <boost/container/detail/container_or_allocator_rebind.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
//for C++03 compilers, were type-puning is the only option for std::pair
|
//for C++03 compilers, were type-puning is the only option for std::pair
|
||||||
//disable strict aliasing to reduce problems.
|
//disable strict aliasing to reduce problems.
|
||||||
#if defined(BOOST_GCC) && (BOOST_GCC >= 100000) && !defined(BOOST_CONTAINER_STD_PAIR_IS_MOVABLE)
|
#if defined(BOOST_GCC) && (BOOST_GCC >= 100000) && !defined(BOOST_CONTAINER_STD_PAIR_IS_MOVABLE)
|
||||||
@ -1788,7 +1791,11 @@ template <class Key, class T, class Compare, class AllocatorOrContainer>
|
|||||||
struct has_trivial_destructor_after_move<boost::container::flat_map<Key, T, Compare, AllocatorOrContainer> >
|
struct has_trivial_destructor_after_move<boost::container::flat_map<Key, T, Compare, AllocatorOrContainer> >
|
||||||
{
|
{
|
||||||
typedef typename boost::container::flat_map<Key, T, Compare, AllocatorOrContainer>::value_type value_t;
|
typedef typename boost::container::flat_map<Key, T, Compare, AllocatorOrContainer>::value_type value_t;
|
||||||
|
#ifdef BOOST_CONTAINER_STD_PAIR_IS_MOVABLE
|
||||||
|
typedef AllocatorOrContainer alloc_or_cont_t;
|
||||||
|
#else
|
||||||
typedef typename ::boost::container::dtl::container_or_allocator_rebind<AllocatorOrContainer, value_t>::type alloc_or_cont_t;
|
typedef typename ::boost::container::dtl::container_or_allocator_rebind<AllocatorOrContainer, value_t>::type alloc_or_cont_t;
|
||||||
|
#endif
|
||||||
typedef ::boost::container::dtl::flat_tree<value_t,::boost::container::dtl::select1st<Key>, Compare, alloc_or_cont_t> tree;
|
typedef ::boost::container::dtl::flat_tree<value_t,::boost::container::dtl::select1st<Key>, Compare, alloc_or_cont_t> tree;
|
||||||
BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<tree>::value;
|
BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<tree>::value;
|
||||||
};
|
};
|
||||||
@ -3143,7 +3150,11 @@ template <class Key, class T, class Compare, class AllocatorOrContainer>
|
|||||||
struct has_trivial_destructor_after_move< boost::container::flat_multimap<Key, T, Compare, AllocatorOrContainer> >
|
struct has_trivial_destructor_after_move< boost::container::flat_multimap<Key, T, Compare, AllocatorOrContainer> >
|
||||||
{
|
{
|
||||||
typedef typename boost::container::flat_multimap<Key, T, Compare, AllocatorOrContainer>::value_type value_t;
|
typedef typename boost::container::flat_multimap<Key, T, Compare, AllocatorOrContainer>::value_type value_t;
|
||||||
|
#ifdef BOOST_CONTAINER_STD_PAIR_IS_MOVABLE
|
||||||
|
typedef AllocatorOrContainer alloc_or_cont_t;
|
||||||
|
#else
|
||||||
typedef typename ::boost::container::dtl::container_or_allocator_rebind<AllocatorOrContainer, value_t>::type alloc_or_cont_t;
|
typedef typename ::boost::container::dtl::container_or_allocator_rebind<AllocatorOrContainer, value_t>::type alloc_or_cont_t;
|
||||||
|
#endif
|
||||||
typedef ::boost::container::dtl::flat_tree<value_t,::boost::container::dtl::select1st<Key>, Compare, alloc_or_cont_t> tree;
|
typedef ::boost::container::dtl::flat_tree<value_t,::boost::container::dtl::select1st<Key>, Compare, alloc_or_cont_t> tree;
|
||||||
BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<tree>::value;
|
BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<tree>::value;
|
||||||
};
|
};
|
||||||
|
@ -15,7 +15,9 @@
|
|||||||
#include <boost/container/devector.hpp>
|
#include <boost/container/devector.hpp>
|
||||||
#include <boost/container/deque.hpp>
|
#include <boost/container/deque.hpp>
|
||||||
|
|
||||||
|
#ifndef BOOST_CONTAINER_STD_PAIR_IS_MOVABLE
|
||||||
#include <boost/container/detail/container_or_allocator_rebind.hpp>
|
#include <boost/container/detail/container_or_allocator_rebind.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "flat_map_test.hpp"
|
#include "flat_map_test.hpp"
|
||||||
#include <map>
|
#include <map>
|
||||||
@ -32,13 +34,21 @@ struct GetMapContainer
|
|||||||
typedef flat_map< ValueType
|
typedef flat_map< ValueType
|
||||||
, ValueType
|
, ValueType
|
||||||
, std::less<ValueType>
|
, std::less<ValueType>
|
||||||
|
#ifdef BOOST_CONTAINER_STD_PAIR_IS_MOVABLE
|
||||||
|
, VoidAllocatorOrContainer
|
||||||
|
#else
|
||||||
, typename boost::container::dtl::container_or_allocator_rebind<VoidAllocatorOrContainer, type_t>::type
|
, typename boost::container::dtl::container_or_allocator_rebind<VoidAllocatorOrContainer, type_t>::type
|
||||||
|
#endif
|
||||||
> map_type;
|
> map_type;
|
||||||
|
|
||||||
typedef flat_multimap< ValueType
|
typedef flat_multimap< ValueType
|
||||||
, ValueType
|
, ValueType
|
||||||
, std::less<ValueType>
|
, std::less<ValueType>
|
||||||
|
#ifdef BOOST_CONTAINER_STD_PAIR_IS_MOVABLE
|
||||||
|
, VoidAllocatorOrContainer
|
||||||
|
#else
|
||||||
, typename boost::container::dtl::container_or_allocator_rebind<VoidAllocatorOrContainer, type_t>::type
|
, typename boost::container::dtl::container_or_allocator_rebind<VoidAllocatorOrContainer, type_t>::type
|
||||||
|
#endif
|
||||||
> multimap_type;
|
> multimap_type;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user