Re: [boost] [any] interest in boost::variant style visitors for boost::any?

AMDG "Korcan Hussein" wrote:
"Steven Watanabe " wrote:
Do you intend to make boost::any a typedef then?
That would do it unless there is some non-obvious ambiguity that this may cause.
Not that I know of.
Basically what i meant was you have 4 cases of: cosntant visitor visits constant and non-constant visitee non-constant visitor visits constant and non-constant visitee constant visitee accepts cosntant & non-constant visitor non-constant visitee accepts cosntant & non-constant visitor
Ok.
For this last I don't think there is a good non-intrusive solution.
Are you talking about the complete solution or catch-all part? i don't see exactly how this is an intrusive solution so please elaborate/clarify.
It isn't. I was thinking specifically about dynamic_any.
If the default is to throw an exception then it effectively limits the contained type to those enumerated. In this case it is probably better to use variant in the first place.
I don't see what the problem is since a user can override the default or later extend there original visitor to support new (set) type(s), as well as override the definition of the old supported types if he/she wishes.
I don't quite understand. Would I extend it statically or dynamically?
This solution seems to be much better than type casting (for every type wanted) & type switching code that you have to do with boost::any::. If no one likes the idea of a default catch-all/generic visit and have a better alternative then i'm open to it since this isn't set in stone and isn't diffcult to change since the implementation is so trivial :) Actually when i think about it the "catch-all" isn't even really need/necessary, the original reason why i put it in in the first place was as a constrast to generic visits of with boost::variant visitors.
You still need a catch-all even if it is not exposed to the user, don't you?
Anyways it looks as if no one is interested, even just to make a comment of any form :( Thanks Korcan Hussien.
In Christ, Steven Watanabe
participants (1)
-
Steven Watanabe