Boost logo

Boost Users :

Subject: [Boost-users] [range] can't use boost::any_range with RTTI disabled due to boost::polymorphic_downcast
From: Adam Romanek (romanek.adam_at_[hidden])
Date: 2014-05-06 06:42:47


Hi!

I'd like to draw your attention to an issue with boost::any_range that
prevents it from being used with RTTI disabled. The problem is that
boost::any_range indirectly uses boost::polymorphic_downcast which in
turn uses dynamic_cast. Note that the dynamic_cast is only used to
ensure the requested cast is valid and it's done only in non-release
builds. It would be great if the check was simply skipped in
RTTI-disabled environments, as it is done in release builds. This would
result in loss of safety that boost::polymorphic_downcast provides but
the pieces that use it would at least compile in RTTI-disabled environments.

Would it be possible to fix this problem?

If you wish I could create a ticket for this issue.

BTW, there's a typo in the documentation of boost::any_range [1]. It
mentions boost::forward_pass_traversal_tag, which does not exist. It
should rather be boost::forward_traversal_tag.

WBR,
Adam Romanek

[1]
http://www.boost.org/doc/libs/1_55_0/libs/range/doc/html/range/reference/ranges/any_range.html


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net