This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: New const char* ctor for C++-0x
On 12/23/2009 10:44 AM, Jonathan Wakely wrote:
> #include <bitset>
> struct X {
> operator const char* () { return "10101010"; }
> };
>
> int main()
> {
> X x;
> std::string s(x);
> std::bitset<32> b1(x);
> std::bitset<32> b2(s);
> VERIFY( b1 == b2 );
> }
>
> With your patch applied this passes in c++0x mode, but not otherwise.
>
Good idea. Eventually, let's also remember to remove from the patch that
damn size_t __len = 0;
Paolo.