RE: [Boost-Users] Problem with 1.30.0 lexical_cast
Well, actually, looks like it lies elsewhere. I rolled back to 1.29.0 and its still broken :(
-----Original Message----- From: Terje Slettebø [mailto:tslettebo@chello.no] Sent: Wednesday, March 26, 2003 9:15 PM To: Boost-Users@yahoogroups.com Subject: Re: [Boost-Users] Problem with 1.30.0 lexical_cast
From: "Tom Matelich" <tmatelich@zetec.com>
Compiler: gcc 3.2 and 3.2.2
I believe this is actually a bug in gcc, but I'm going to post it hopes that someone can help me. We have a handy little tool for generating enums with associated string conversion and stream insertion/extraction functions. When we upgraded to boost 1.30.0, lexical_cast'ing one of these enums to std::string started behaving incorrectly, rather than the name, it is giving me the integral value. It seems that the lexical_stream is being used. Unfortunately, my test case is working fine. The complete test case (including definition of ZAcquisition::PPG) is appended at the end. The code I am seeing failure with looks like:
void foo(ZAcquisition::PPG::Type gt) { ... std::string str; str = boost::lexical_cast<std::string>(gt); std::cerr << "DEBUG, storing encode for PPG: " << str << ", aka " << gt << std::endl; ... }
This outputs (for example): DEBUG, storing encode for PPG: 0, aka ONE
I tried boost::lexical_cast<std::string, ZAcquisition::PPG::Type>(gt) as well.
Anyone have any ideas? For now I'm going to back out to 1.29.0's lexical_cast.
It happens on my Windows/Intel 7.0 box as well.
It's a little difficult when you don't have a failing test case. If you had that, I could have looked into it. The above code works correctly on Intel C++ 7.0 (Windows), here.
Regards,
Terje
------------------------ Yahoo! Groups Sponsor ---------------------~--> Get 128 Bit SSL Encryption! http://us.click.yahoo.com/xaxhjB/hdqFAA/xGHJAA/EbFolB/TM -------------------------------------------------------------- -------~->
Info: <http://www.boost.org> Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl> Unsubscribe: <mailto:boost-users-unsubscribe@yahoogroups.com>
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
----------------------------------------------------------------------- DISCLAIMER: Information contained in this message and/or attachment(s) may contain confidential information of Zetec, Inc. If you have received this transmission in error, please notify the sender by return email. -----------------------------------------------------------------------
participants (1)
-
Tom Matelich