user-defined types and basic_string

Anthony Feick afeick@hotmail.com
Fri Aug 30 12:46:00 GMT 2002


>
>    inline character<unsigned short>
>    as_character(unsigned short c)
>    {
>      character<unsigned short> r = { c };
>      return c;
>    }
>
>With inlining and the named return value optimization, that should
>cost nothing.
>

Unfortunatley the cost is changing a LOT of code for us.  Our code is a 
mess, and it is just not worth it if "char_traits<unsigned short>" will fix 
it for us easily.

>
>As noted in the discussion, that may or may not work with other
>implementations or future versions of V3.  Only you know how portable
>you want your constructs.

Forward/backward incompatibility is really nothing new for libstdc++ (or 
Microsoft STL either). ;-)


-Tony


_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com



More information about the Libstdc++ mailing list