From: Glyn M. <gly...@gm...> - 2008-10-13 12:32:53
|
Hi, 2008/10/13 Kim Gräsman <kim...@gm...> > Hi Dean, > > On Mon, Oct 13, 2008 at 12:45, Dean Michael Berris > <mik...@gm...> wrote: > > > >> On an unrelated note, doesn't using ostringstream always require > >> basic_string? And char_type is not orthogonal to string_type and > char_type. > >> > > > > template <> string<network::tags::default_> { > > typedef std::string type; > > }; > > > > template <> struct string<network::tags::wide_default_> { > > typedef std::wstring type; > > }; > > > > [...] > > I wonder if what Glyn is looking for is something like: > > template <> char_based_traits<network::tags::default_> { > typedef std::string string_type; > typedef std::ostringstream ostringstream_type; > typedef char char_type; > }; > > so that related traits are defined together, and orthogonal traits > separately. Just guessing, though. But it doesn't make intuitive sense > to me to specialize them separated from each other, when they're all > based on the definition of char. > > Yes but I want to go further and say why can't we used std::char_traits directly? I understand that this prevents us from using our own string types that don't use basic_string, but if we're going to use ostringstream internally anyway, why do we make it more difficult for ourselves? Taking the long view and we target eventual inclusion into boost, would it be better to use the standard way of doing this? cf. Boost.Filesystem? Glyn |