
Tom Widmer wrote:
Anything is convertible to boost::any, and since you have an operator<< for boost::any, it will catch any object that doesn't have a better matched operator<< (i.e. any one that doesn't require a user defined conversion). If this didn't happen, you'd just get a compiler error when you tried to create an any<A>, since creation of that requires instantiation of all virtual functions of holder<A>, including the ill-formed print member (e.g. no overload matches the call out<<held).
that explains it, thank's
Dispatching to some kind of default call (which might just set failbit on the stream, or you could make it configurable) is probably the best way to handle this.
could you elaborate on that, what do you mean by defaul call?
Tom
Sérgio