Opened 8 years ago

Closed 8 years ago

#2755 closed Bugs (fixed)

compile error in boost_intrusive 1.38.0: a set of classes with protected destructor

Reported by: fmot.fics@… Owned by: igaztanaga
Milestone: Boost 1.39.0 Component: intrusive
Version: Boost 1.38.0 Severity: Problem
Keywords: intrusive is_convertible destructor Cc:


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;




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@…

Attachments (0)

Change History (2)

comment:1 Changed 8 years ago by igaztanaga

Fixed in SVN, revision 51290.

comment:2 Changed 8 years ago by igaztanaga

  • Resolution set to fixed
  • Status changed from new to closed

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain igaztanaga.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.