Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9799: polymorphic_downcast does not support virtual inheritance
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-03-20 17:34:20
#9799: polymorphic_downcast does not support virtual inheritance
-------------------------------------------+---------------------------
Reporter: Camille Gillot <k1000.jlo@â¦> | Owner: no-maintainer
Type: Patches | Status: closed
Milestone: To Be Determined | Component: utility
Version: Boost 1.54.0 | Severity: Problem
Resolution: wontfix | Keywords:
-------------------------------------------+---------------------------
Changes (by steven_watanabe):
* status: new => closed
* resolution: => wontfix
Comment:
The real question is whether should this be supported.
From the documentation: "... or when efficiency is not important,
polymorphic_cast is preferred." Since we have to do a dynamic_cast
anyway, efficiency really doesn't matter.
It's also clear that the behavior is consistent with the documentation:
{{{
#!c++
template <class Derived, class Base>
inline Derived polymorphic_downcast(Base* x);
// Effects: assert( dynamic_cast<Derived>(x) == x );
// Returns: static_cast<Derived>(x)
}}}
Also, your patch doesn't compile.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/9799#comment:1> 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:15 UTC