Subject: [Boost-bugs] [Boost C++ Libraries] #7815: boost/intrusive/detail/has_member_function_callable_with.hpp: inheriting from a const class
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-12-20 10:21:39
#7815: boost/intrusive/detail/has_member_function_callable_with.hpp: inheriting
from a const class
-------------------------------+--------------------------------------------
Reporter: 1czajnik@⦠| Owner: igaztanaga
Type: Bugs | Status: new
Milestone: To Be Determined | Component: intrusive
Version: Boost 1.52.0 | Severity: Problem
Keywords: |
-------------------------------+--------------------------------------------
Hello,
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>
class BOOST_PP_CAT(has_member_function_named_,
BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)
{
struct BaseMixin
{
void
BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME();
};
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
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7815> 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:11 UTC