From: Glyn M. <gly...@gm...> - 2008-04-15 11:24:21
|
Hi Dean, On 15/04/2008, Dean Michael C. Berris <dmb...@fr...> wrote: > > > - I was suggesting earlier to have instead a tag type which > differentiated an http::message from a basic_message, because precisely > to avoid the glob traits facility that we see in message_traits (and > like the standard iterator traits that glob values together). The > approach would be similar to: > > namespace http { namespace tags { > struct message_tag { }; > }; }; > > namespace http { namespace traits { > template <typename Tag> > struct delimiters; > > template <> > struct delimiters<tags::message_tag> { > static char const * const STRING_CRLF = > "\x0D\x0A"; > ... > }; > > template <typename Tag> > struct header_names; > > template <> > struct header<tags::message_tag> { > static char const * const HEADER_HOST = "Host"; > }; > }; }; > > In the above approach, we can then even support wide character strings, > by using a different tag to support wide characters. > > namespace http { > namespace tags { > struct message_tag_w { }; > }; > > namespace traits { > template <> struct > delimiters<tags::message_tag_w> { > static wchar_t const * const CRLF = > L"\x0D\x0A"; > ... > }; > }; > }; Maybe I'm missing something here, but isn't it an error to initialize a static non-integral type inside a struct definition? Regards, Glyn |