9 Commits

Author SHA1 Message Date
Antony Polukhin
2598281d10 drop c++03 support 2023-08-10 18:52:03 +03:00
Julien DELACROIX
e130cd860c boost::polymorphic_downcast only supports raw pointer cast, which is a gap compared to static_cast.
To make it clear:
       Base* base = new Base();

       static_cast<Derived*>(base)                 ===> OK
       static_cast<Derived&>(*base)                ===> OK

       boost::polymorphic_downcast<Derived*>(base)  ===> OK
       boost::polymorphic_downcast<Derived&>(*base) ===> IMPOSSIBLE

    boost::polymorphic_downcast being a kind of "debug-safe version" of
    static_cast, it should provide the same capabilities.

    This patch extend boost::polymorphic_downcast to support references just
    like static_cast does.
    This is achieved by introducing a partial specialization for references.
    Unit tests have been updated accordingly.
2019-12-09 08:51:10 +01:00
Mike Maximoff
181eb0e6fc boost::assertion_failed trapped assertions, and subsequent bad casts were executed anyway. Now it throws exceptions for assert-like behavior. 2016-12-16 10:46:37 +03:00
Antony Polukhin
b6e9403ef0 Fixed warnings in tests 2015-12-14 19:14:28 +03:00
Antony Polukhin
00b6a53f7e Add polymorphic_pointer_cast 2014-11-10 15:02:20 +04:00
Antony Polukhin
6199649ae2 Move polymorphic_pointer_downcast to a separate header, use pragma once and boost::throw_exception 2014-11-10 14:24:39 +04:00
Boris Rasin
582fc91adb add more tests and documentation example for polymorphic_pointer_downcast 2014-11-09 15:37:56 +02:00
Boris Rasin
6a224fa5e9 =add polymorphic_pointer_downcast function template 2014-11-09 00:02:44 +02:00
Peter Dimov
8a03282736 Add additional tests. 2014-06-11 14:35:27 +03:00