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]

Re: PODs vs memset


Hi Gaby,

valarray was intended to work with "numerical" types (a notion that is
fuzzily defined in the Standard), which roughly is what we used to
think of a POD. However, the notion of the POD has been improving and
we may get to the state where POD no longer ressembles what it used to
be. I don't know the actual state of the resolution but I was under
the impression that a pointer to member is now considered a POD. If
that is true, then we get into the situation where a null pointer
wrongly captured -- it is represented as -1, and not 0. That would
invalidate the "optimization". On the other hand, I very much feel
that if someone instantiates valarray with pointer to member type, he/she
gets what he/she deserves. But, I don't get to define the semantics
so I would suggest to just proceed with __is_scalar until we get a
better characterization -- for example, I would really love to have
valarray<complex<double>> be memset'ed (yes, I know I can use traits,
but it would be nice if we come up with a very simple characterization
in C++03 that is simply captured by those reifying functions.


Thanks for the interesting explanation: I saw something going on about POD-ness but didn't really follow the thread. Therefore, for now I'm doing the __is_scalar change, then we can maybe discuss the issue a little more in Oxford...

Thanks again,
Paolo.


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