From: Glyn M. <gly...@gm...> - 2008-04-15 12:05:57
|
On 15/04/2008, Dean Michael C. Berris <dmb...@fr...> wrote: > > > So this will have to come into some unnamed namespace to be included in > every translation unit. Any other approach you can suggest? Would it be possible to do something like the following: namespace http { namespace tags { struct message_tag {}; struct message_tag_w {}; } } namespace http { namespace traits { template < typename Tag > struct delimiters; template <> struct delimiters<tags::message_tag> { static char const *crlf() { static const char *const crlf = "\x0D\x0A"; return crlf; } }; template <> struct delimiters<tags::message_tag_w> { static wchar_t const *crlf() { static const wchar_t *const crlf = L"\x0D\x0A"; return crlf; } }; } } |