From: K. G. <kim...@gm...> - 2008-10-13 13:06:12
|
Hey there, On Mon, Oct 13, 2008 at 14:57, Dean Michael Berris <mik...@gm...> wrote: > >> Yes. But since that tag will be used throughout the implementation, >> passed on to basic_request, basic_message, etc., I'd have to >> specialize all traits for the new tag, even if I'm only changing one, >> right? I think that's where my ability to picture this breaks :) >> > > Actually, not really -- or as far as I recall, not at all. > > Consider the example below: > > template <class Tag> > struct string { > typedef std::string type; > }; > > template <> > struct string<tags::wide_default> { > typedef std::wstring type; > }; > > If you really needed to customize with your own tag, then you can > override the default implementation (unspecialized version). :-D Ah, I see. Yeah, that makes sense. As all the default cases were left with a variation of template <class Tag> struct string { typedef void type; }; , I didn't see that coming. But sure, if the default actually defines defaults, everything will be dandy! :) - Kim |