|
-
December 1st, 2005, 05:30 PM
#1
Need StringStream Alternative
Hi guys,
I've been going crazy with a bug in my very large complex program. I'm using the Intel compiler with Visual Studio. When I use any optimization at all, I have a crash as I exit. It doesn't affect the data, it just looks unsightly and I can't release this with the crash. However, it is critical code. It does not crash in vs.net 2003 compiler, however it runs more slowly. The function crashing is
Code:
template <typename T> std::string to_datastring(T t)
{
std::ostringstream oss;
oss<< std::dec << std::setw(7) << std::showpoint << std::setprecision(5) <<
std::setfill('0')<< std::left << t;
return oss.str();
}
where t is any number. It could be an integer double or float. Does anyone have another way I can do this? I'm not quite sure how to go about fixing this. The code is fast and readable, and I can't reproduce it with a simple test case. However, if I comment out the input line the crash goes away. Any suggestions? Thanks for the help.
~Steve
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|