Opened 22 years ago

Closed 13 years ago

#922 closed Feature Requests (fixed)

Lexical cast and wide characters

Reported by: brey Owned by: nasonov
Milestone: Component: lexical_cast
Version: None Severity: Optimization
Keywords: Cc: kevlin@…

Description (last modified by Dave Abrahams)

It would be nice to make lexical_cast be handle to 
translate through means other than a char-width 
string.  One way to address this is follows:

template<typename Target, typename Source, typename E 
= char>
Target lexical_cast(Source arg)
{
   std::basic_stringstream<E> interpreter;
    ...

Other options, such as using traits to try to deduce E 
from the target type automatically, would be fine, 
too.  Think of the above suggestion as a starting 
point; however, it would plug what it currently a hole.

This feature request is derived from:
http://groups.yahoo.com/group/boost/message/10937

Change History (6)

comment:1 by Dave Abrahams, 15 years ago

Cc: kevlin@… added
Description: modified (diff)
Severity: Showstopper

Can't reassign this to Kevlin until he enters his email as described at TicketWorkflow

comment:2 by Peter Dimov, 15 years ago

Component: Nonelexical_cast
Severity: ShowstopperOptimization

comment:3 by Marshall Clow, 15 years ago

Owner: changed from nobody to nasonov
Status: assignednew

comment:4 by anonymous, 13 years ago

Resolution: Nonefixed
Status: newclosed

It would be nice to make lexical_cast be handle to

translate through means other than a char-width string. lexical_cast supports wchar_t.

Other options, such as using traits to try to deduce E

from the target type automatically, would be fine, too. lexical_cast deduces E from both target and source types.

comment:5 by nasonov, 13 years ago

Resolution: fixed
Status: closedreopened

comment:6 by nasonov, 13 years ago

Resolution: fixed
Status: reopenedclosed

(closing it properly this time, unanonymously and with a better formatting)

It would be nice to make lexical_cast be handle to translate through means other than a char-width string.

lexical_cast supports wchar_t.

Other options, such as using traits to try to deduce E from the target type automatically, would be fine, too.

lexical_cast deduces E from both target and source types.

Note: See TracTickets for help on using tickets.