From: Michael D. <mi...@mi...> - 2008-04-20 20:20:15
|
The new approach sounds (and now, looks) good to me. Although I noticed that parser_traits.hpp appears to be just a copy of the traits.hpp file (the parser constants seem to have been lost somewhere in the update). Whether these are called 'parser_traits', 'parser_consts' or anything else is fine with me =) -Mike On Apr 15, 2008, at 5:18 AM, Dean Michael C. Berris wrote: >> -----Original Message----- >> From: cpp...@li... >> [mailto:cpp...@li...] On >> Behalf Of Glyn Matthews >> Sent: Tuesday, April 15, 2008 8:06 PM >> To: C++ Networking Library Developers Mailing List >> Subject: Re: [cpp-netlib-devel] Review of http::message >> >> >> 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; >> } >> }; >> } >> } >> > > I like it. Thanks Glyn. :) > > It looks like stuff that the compiler will inline anyway because it > has > full type information with everything being static and all. However, > it > will change the way these are accessed -- instead of just doing > values, > we need to make function calls... > > Perhaps it may work. > > Mike, would that be too much of a trouble? I as much as possible would > like to avoid anonymous namespaces because of the ODR. > > -- > Dean Michael Berris > Software Engineer, Friendster, Inc. > <dmb...@fr...> > +639287291459 > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save > $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Cpp-netlib-devel mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cpp-netlib-devel > |