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++/16054] New: basic_string incorrectly handles allocator arguments


library bits/basic_string:
As in all other C++ standard types that use dynamic allocation,all constructor
forms of the the class std::basic_string should take an allocator argument with
a default value; the default being the default-constructor of the allocator
type of the template.

However, the constructor:
      basic_string(const basic_string& __str);
has no allocator and:
      basic_string(const basic_string& __str, size_type __pos,
                 size_type __n, const _Alloc& __a);
has no default.


Also, the constructors:
      basic_string(const basic_string& __str, size_type __pos,
                 size_type __n = npos);
and
      basic_string(const basic_string& __str, size_type __pos,
                 size_type __n, const _Alloc& __a);

can be merged to:
      basic_string(const basic_string& __str, size_type __pos,
                 size_type __n = npos, const _Alloc& __a = _Alloc());

-- 
           Summary: basic_string incorrectly handles allocator arguments
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: igodard at pacbell dot net
                CC: gcc-bugs at gcc dot gnu dot org


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


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