:

Stringstream operator >>

Added by: ~LB, 2010 VIII 18, Last modified by: tomek, 2010 VIII 18

Added by: ~LB, 2010 VIII 18, Last modified by: tomek, 2010 VIII 18

Hi.I'm using a string stream to convert Big<> numbers to and from strings. Converting to a string works just fine, but converting from a string crashes. I have this code:

typedef ttmath::Big<TTMATH_BITS(512),TTMATH_BITS(512)> BigFloat;

BigFloat StringToBigFloat(string Str)
{
istringstream StrStream;
StrStream.str(Str);
BigFloat Ret;
StrStream >>Ret; //this line crashes!!
return(Ret);
}

Is there a way I can fix this or do I have to wait until a fixed version is released?

Added by: ~LB, 2010 VIII 18

Sorry about everything on one line, I'm not sure how that happened!!

Added by: tomek, 2010 VIII 18

Thanks, there was a recurrence calling in:
Big::FromString(const std::string &, uint, const wchar_t **, bool *)

The method should take char** instead of wchar_t**:
Big::FromString(const std::string &, uint, const char **, bool *)

Corrected in repository:
svn co svn://ttmath.org/publicrep/ttmath/trunk ttmath

Official fix will be soon.