This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]