Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11323: is_virtual_base_of fails to build when virtual bases and their ancestors define identical virtual functions
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-05-20 17:46:45
#11323: is_virtual_base_of fails to build when virtual bases and their ancestors
define identical virtual functions
-----------------------------------+-------------------------
Reporter: leandro.gracia.gil@⦠| Owner: johnmaddock
Type: Bugs | Status: new
Milestone: To Be Determined | Component: type_traits
Version: Boost 1.57.0 | Severity: Problem
Resolution: | Keywords:
-----------------------------------+-------------------------
Comment (by leandro.gracia.gil@â¦):
I don't see any either... I'll keep thinking too.
BTW, in case somebody seeing this is wondering why we don't simply make
foo a pure virtual in A and avoid the issue altogether, let me share a
more meaningful example where this becomes a problem.
{{{
#include <iostream>
#include <boost/type_traits.hpp>
// Let's say enabling RTTI is not an option in our platform / project.
#define ASSIGN_CLASS_ID() virtual int GetClassId() { return __COUNTER__; }
struct A { ASSIGN_CLASS_ID(); };
struct B : public virtual A { ASSIGN_CLASS_ID(); };
struct C : public B { ASSIGN_CLASS_ID(); };
int main() {
std::cout << boost::is_virtual_base_of<B, C>::value << std::endl;
return 0;
}
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11323#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:18 UTC