Opened 5 years ago

Closed 5 years ago

#7815 closed Bugs (fixed)

boost/intrusive/detail/has_member_function_callable_with.hpp: inheriting from a const class

Reported by: 1czajnik@… Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: intrusive
Version: Boost 1.52.0 Severity: Problem
Keywords: Cc: 1czajnik@…



I tried to use a boost::container::vector with a Texas Instruments compiler, and I got an error pointing to line 88 of <boost/intrusive/detail/has_member_function_callable_with.hpp> "Invalid base class", with Type=const std::allocator<something>"

Here's the context:

      template <typename Type>
         struct BaseMixin

         struct Base : public Type, public BaseMixin { Base(); }; // <-- line 88

The problem seems to be the constness of Type. Here's a simplified example:

struct X {};

template < class T >
struct Y : T { Y() {} };

int main()
    Y<const X> y;

The above example compiles fine with Linux gcc version 4.5.4, and MinGW 4.5.0, but fails with my TI compiler.

For now, my workaround is:

struct Base : public ::boost::remove_cv<Type>::type, public BaseMixin { Base(); }; // <-- line 88

Attachments (1)

7815.patch (714 bytes) - added by 1czajnik@… 5 years ago.

Download all attachments as: .zip

Change History (3)

Changed 5 years ago by 1czajnik@…

Attachment: 7815.patch added

comment:1 Changed 5 years ago by Krzysztof Czaiński <1czajnik@…>

Cc: 1czajnik@… added

comment:2 Changed 5 years ago by Ion Gaztañaga

Resolution: fixed
Status: newclosed

Thanks for the report, fixed in trunk in revision 82126.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Ion Gaztañaga.
The resolution will be deleted.

Add Comment

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

Note: See TracTickets for help on using tickets.