Re: [Boost-bugs] [Boost C++ Libraries] #3996: Enable use of BOOST_FOREACH over const-ref of noncopyable ptr_containers

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3996: Enable use of BOOST_FOREACH over const-ref of noncopyable ptr_containers
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-06-24 22:17:58


#3996: Enable use of BOOST_FOREACH over const-ref of noncopyable ptr_containers
--------------------------------------------------------+-------------------
  Reporter: Kazutoshi Satoda <k_satoda@…> | Owner: nesotto
      Type: Patches | Status: new
 Milestone: Boost 1.43.0 | Component: ptr_container
   Version: Boost 1.42.0 | Severity: Problem
Resolution: | Keywords: BOOST_FOREACH is_noncopyable
--------------------------------------------------------+-------------------

Comment (by eric_niebler):

 Do NOT accept this patch. For every instantiation of
 reversible_ptr_container, you are instantiating foreach::is_noncopyable to
 (optionally) inherit from noncopyable. This is the wrong way to do it and
 will lead to ODR violations when different translation units see different
 specializations of foreach::is_noncopyable. Instead, define a partial
 specialization of foreach::is_noncopyable< reversible_ptr_container<...>
>:

 {{{
 namespace boost { namespace foreach {
   template<typename T, typename A, typenale CA>
   struct is_noncopyable<ptr_vector<T,A,CA> > : is_noncopyable<T> {};
 }}
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3996#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:03 UTC