This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug libstdc++/53221] New: [C++11] basic_string lacks "copy/move constructors" with allocator


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53221

             Bug #: 53221
           Summary: [C++11] basic_string lacks "copy/move constructors"
                    with allocator
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: daniel.kruegler@googlemail.com


The library implementation of gcc 4.8.0 20120429 (experimental) misses the
following "copy/move constructors" with allocators:

basic_string(const basic_string&, const Allocator&);
basic_string(basic_string&&, const Allocator&);

These were added to the working draft with acceptance of the allocator proposal

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2554.pdf 

The following test case fails:

//---
#include <string>
#include <memory>

int main()
{
  std::string s1;
  std::string s2(s1, std::allocator<char>());
  std::string s3(static_cast<std::string&&>(s1), std::allocator<char>());
}
//---


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