Boost logo

Boost :

From: d.frey_at_[hidden]
Date: 2000-11-20 05:02:37


I'm new to this group and I haven't found anything about the things
I'd like to ask, so please just point me to the right place if it was
already discussed.

I heard about lexical_cast on comp.std.c++ and I liked the idea of a
convert-everything-to-everything-function very much. So I joined this
eGroup and read the lexical_cast/ - files. And while looking at it,
two questions came up to me:

1) Why does lexical_cast requires the Source to be Copy-Constructable?
Why is lexical_cast's argument defined as 'Source arg' instead of
'const Source& arg'?

2) I was a bit worried about performance. A small test showed that
when converting 'int' to 'string' (IMHO a very common case),
lexical_cast was about 18 times slower than a 'native' function. Maybe
this depends on my compiler, STL, the weather... but I think that this
might be a general problem. As I don't know if speed matters for you
or if you have discussed on this issue before, I'd like to get some
feedback before sending my test-sources, complaining too loud, etc. ;)

Regards, Daniel

Boost list run by bdawes at, gregod at, cpdaniel at, john at