"Pete Bartlett"
I only compiled and ran the code in my head but I think it is quite dangerous. Isn't the only reason it compiles is because operator<<(ostream&,any const&) is recursive in the case that the any holds a non-streamable type? E.g. the C in your case. Thus, if the user accidentally tries to stream a non-streamable type he hard-crashes his program by blowing the stack... and because it is an any he has no means of knowing for sure if the contents are streamable at instantiation time. He has to "trust to luck". The OP might not like the term "type-safe" but here the downsides of non-type safety are showing themselves up!
Of course a more advanced implementation might go down a has_operator_stream metafunction route. But then you are getting well away from the spirit of Any and towards that of Adobe.Poly as another posted mentioned.
I agree. I've made boost::any a template -- so that it get's passed a callback type. Is this according to your standards? I think boost::any without any way to apply something to it, is quite useless. Peter