[Boost-bugs] [Boost C++ Libraries] #2755: compile error in boost_intrusive 1.38.0: a set of classes with protected destructor

Subject: [Boost-bugs] [Boost C++ Libraries] #2755: compile error in boost_intrusive 1.38.0: a set of classes with protected destructor
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-02-12 20:35:39


#2755: compile error in boost_intrusive 1.38.0: a set of classes with protected
destructor
-------------------------------------------------+--------------------------
 Reporter: fmot.fics_at_[hidden] | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: Boost 1.39.0 | Component: intrusive
  Version: Boost 1.38.0 | Severity: Problem
 Keywords: intrusive is_convertible destructor |
-------------------------------------------------+--------------------------
 the following short code generates a compiler error:

 #include <stdio.h>

 #include <boost/intrusive/set.hpp>
 #include <boost/noncopyable.hpp>

 using namespace boost::intrusive;

 struct node_t :
         set_base_hook<optimize_size<true> >
 {
         bool operator < (const node_t& right) const;
 protected:
         ~node_t();
 };

 int main(int argc, char* argv[])
 {
         set<node_t> nodes;
         nodes.insert(* new node_t);
         return 0;
 }

 // end of code

 reason of compiler error:

 in /boost/intrusive/detail/mpl.hpp, line 69:

 static const bool value = sizeof(dispatch(trigger())) == sizeof(true_t);

 trigger() function (line 67) returns an instance, thus forcing a compiler
 to look for destructor. it the sample above the destructor is protected,
 so it can't be accessed.

 suggested solution:
 in /boost/intrusive/detail/mpl.hpp, line 67:
 static const T& trigger();

 boost 1.37.0 had no such problem

 best regards, vlad
 fmot.fics_at_[hidden]

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2755>
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:49:59 UTC