Boost logo

Boost :

Subject: Re: [boost] [type_erasure] Downcasting is now possible
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2015-03-10 09:33:47


On 08/03/2015 05:27, Steven Watanabe wrote:

> The calls to register_binding are necessary for
> this to work, unfortunately. I don't think it's
> possible to implement dynamic_any_cast without
> some kind of registration, but at least it only
> needs to be called once for each concept/type
> combination. If anyone has any better ideas
> about how to handle this, I'd love to hear it.

If you're doing this, you might as well implement full dynamic duck typing.
If the expression is valid, you call it, otherwise you raise an exception.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk