Add C++-0x char* cotor and to_ullong to bitset
3dw4rd@verizon.net
3dw4rd@verizon.net
Fri Dec 18 17:51:00 GMT 2009
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
More information about the Libstdc++
mailing list