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: Re: Add C++-0x char* cotor and to_ullong to bitset




Dec 18, 2009 12:21:54 PM, paolo.carlini@oracle.com wrote:

On 12/18/2009 05:52 PM, 3dw4rd@verizon.net wrote:
> This little patch adds
>   explicit bitset(const char*);
>   
Let's do this first, which seems more straightforward. Please, split the
patch. Of course, let's not re-invent the wheel, thus let's use
__builtin_strlen, something like, in the body of the constructor:

    if (__str)
      {
         const size_t __len = __builtin_strlen(...);
         this->_M_copy_from_ptr(... uses __len...);
       }

Paolo.
-----------------------

OK, that reuse seems reasonable.

So you're thinking this:
Patch 1. explicit bitset(const char*); with the fixes above
Patch 2. unsigned long long to_ullong();

Actually, in C++-0X:
3. explicit bitset(unsigned long long) replaces explicit bitset(unsigned long).
I missed that.

This would only be applied if std=c++0x *and* if long long is supported of course.
I thought changing the word size in the base would break ABI compatibility.
Instead we would compute WORDS_PER_ULLONG or something and read in words out of the long long.

Ed


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