Opened 14 years ago

Closed 12 years ago

#1920 closed Bugs (fixed)

lexical_cast with tuple target fails, because of cleared skipws flag

Reported by: Bryan Green <bryan.d.green@…> Owned by: Joel de Guzman
Milestone: Boost 1.36.0 Component: tuple
Version: Boost Development Trunk Severity: Problem
Keywords: tuple tuple_io lexical_cast Cc:

Description

Doing a lexical_cast to a tuple does not work, because lexical_cast clears the skipws flag.

The issue is described in the FAQ for lexical_cast: http://www.boost.org/doc/libs/1_35_0/libs/conversion/lexical_cast.htm#faq

The tuple's operator>> apparently needs to set the iostate appropriately.

Attachments (2)

tup.cpp (268 bytes ) - added by Bryan Green <bryan.d.green@…> 14 years ago.
example program demonstrating the bug.
tuple_io.patch (1020 bytes ) - added by Bryan Green <bryan.d.green@…> 14 years ago.
a patch to tuple_io.hpp to fix the bug.

Download all attachments as: .zip

Change History (3)

by Bryan Green <bryan.d.green@…>, 14 years ago

Attachment: tup.cpp added

example program demonstrating the bug.

by Bryan Green <bryan.d.green@…>, 14 years ago

Attachment: tuple_io.patch added

a patch to tuple_io.hpp to fix the bug.

comment:1 by Steven Watanabe, 12 years ago

Resolution: fixed
Status: newclosed

(In [62678]) Make reading a tuple work with std::noskipws. Fixes #1920

Note: See TracTickets for help on using tickets.