This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[RFC] Two puzzling things in num_put::do_put(void*)
- From: Paolo Carlini <pcarlini at suse dot de>
- To: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Cc: Benjamin Kosnik <bkoz at redhat dot com>, Andreas Jaeger <aj at suse dot de>
- Date: Mon, 08 Dec 2003 10:15:33 +0100
- Subject: [RFC] Two puzzling things in num_put::do_put(void*)
Hi,
the most important one is the presence of a try/catch construct:
__io.flags(__flags & __fmt | (ios_base::hex | ios_base::showbase));
try
{
__s = _M_insert_int(__s, __io, __fill,
reinterpret_cast<unsigned long>(__v));
__io.flags(__flags);
}
catch (...)
{
__io.flags(__flags);
__throw_exception_again;
}
which is not present in num_get::do_get(void*&), or in any other
num_get/num_put virtual for that matter. Indeed, I don't find
support for its presence in the standard...
Less important, I think there is the hidden assumption that
sizeof(void*) == sizeof(unsigned long). This is probably true (on
64 bit platforms too, if I understand well some notes prepared by
Andreas) but I'm not sure if it's something we can really be 100%
confident about.
Paolo.