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: New const char* ctor for C++-0x


On 12/22/2009 05:07 PM, Ed Smith-Rowland wrote:
> OK?
Not yet.

+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      /**
+       *  @brief  Construct from a string.
+       *  @param  str  A string of '0' and '1' characters.
+       *  @throw  std::invalid_argument  If a character appears in the string
+       *                                 which is neither '0' nor '1'.
+       */
+      explicit
+      bitset(const char* __str)
+      : _Base()
+      {
+	size_t __len = 0;

???

+	if (__str)
+	  {
+	    const size_t __len = __builtin_strlen(__str);
+	    _M_copy_from_ptr<char,std::char_traits<char>>

Always a space after the comma.

Also, please try to simplify the testcase: I can't believe that in order
to test such a small feature we need <algorithm>, <cstring>, etc!

Paolo.


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