boostorg / container

STL-like containers from Boost
http://www.boost.org/libs/container/
Boost Software License 1.0
96 stars 116 forks source link

Fix incomplete type error when using list with pair #222

Closed orgads closed 2 years ago

orgads commented 2 years ago

Example:

boost::container::list<std::pair<int, int>> list;
.../boost/container/allocator_traits.hpp:403:11: error: invalid use of incomplete type 'struct boost::container::dtl::pair<int, int>'
  403 |    {  p->~T(); (void)p;  }
      |       ~~~~^
In file included from .../boost/container/detail/node_alloc_holder.hpp:39,
                 from .../boost/container/list.hpp:34:
.../boost/container/detail/is_pair.hpp:59:8: note: declaration of 'struct boost::container::dtl::pair<int, int>'
   59 | struct pair;
      |        ^~~~
igaztanaga commented 2 years ago

Thanks for the patch. I'm applying and alternative patch as more containers (like slist) are affected by the same bug.