[Bug libstdc++/40299] New: Rope + C++0x mode = build error

2009-05-29 Thread mlcreech at gmail dot com
When compiling a simple program in C++0x mode, attempting to instantiate a rope
yields this error:

$ g++ -o test test.cpp -std=gnu++0x
In file included from
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.0/include/g++-v4/ext/rope:63,
 from test.cpp:1:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.0/include/g++-v4/ext/memory: In function
'std::pair<_InputIter, _ForwardIter>
__gnu_cxx::uninitialized_copy_n(_InputIter, _Size, _ForwardIter) [with
_InputIter = char*, _Size = long unsigned int, _ForwardIter = char*]':
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.0/include/g++-v4/ext/rope:865:  
instantiated from 'void __gnu_cxx::_Rope_RopeSubstring<_CharT,
_Alloc>::operator()(size_t, size_t, _CharT*) [with _CharT = char, _Alloc =
std::allocator]'
test.cpp:7:   instantiated from here
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.0/include/g++-v4/ext/memory:124: error:
call of overloaded '__uninitialized_copy_n(char*&, long unsigned int&, char*&,
std::random_access_iterator_tag)' is ambiguous
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.0/include/g++-v4/ext/memory:74: note:
candidates are: std::pair<_InputIter, _ForwardIter>
__gnu_cxx::__uninitialized_copy_n(_InputIter, _Size, _ForwardIter,
std::input_iterator_tag) [with _InputIter = char*, _Size = long unsigned int,
_ForwardIter = char*]
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.0/include/g++-v4/ext/memory:93: note:
   std::pair<_InputIter, _ForwardIter>
__gnu_cxx::__uninitialized_copy_n(_RandomAccessIter, _Size, _ForwardIter,
std::random_access_iterator_tag) [with _RandomAccessIter = char*, _Size = long
unsigned int, _ForwardIter = char*]
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.0/include/g++-v4/bits/stl_uninitialized.h:454:
note: _ForwardIterator
std::__uninitialized_copy_n(_RandomAccessIterator, _Size, _ForwardIterator,
std::random_access_iterator_tag) [with _RandomAccessIterator = char*, _Size =
long unsigned int, _ForwardIterator = char*]
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.0/include/g++-v4/bits/stl_uninitialized.h:433:
note: _ForwardIterator
std::__uninitialized_copy_n(_InputIterator, _Size, _ForwardIterator,
std::input_iterator_tag) [with _InputIterator = char*, _Size = long unsigned
int, _ForwardIterator = char*]


-- 
   Summary: Rope + C++0x mode = build error
   Product: gcc
   Version: 4.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mlcreech at gmail dot com
 GCC build triplet: x86_64-pc-linux-gnu
  GCC host triplet: powerpc-linux-gnu
GCC target triplet: powerpc-linux-gnu


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



[Bug libstdc++/40299] Rope + C++0x mode = build error

2009-05-29 Thread mlcreech at gmail dot com


--- Comment #1 from mlcreech at gmail dot com  2009-05-29 21:38 ---
Created an attachment (id=17933)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17933&action=view)
Trivial test program

Compile with:

g++ -o test test.cpp -std=c++0x


-- 


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



[Bug libstdc++/47773] New: Versatile string lacks a default hash function

2011-02-16 Thread mlcreech at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47773

   Summary: Versatile string lacks a default hash function
   Product: gcc
   Version: 4.5.1
Status: UNCONFIRMED
  Severity: minor
  Priority: P3
 Component: libstdc++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: mlcre...@gmail.com


Created attachment 23368
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23368
Example code

__gnu_cxx::__vstring is a nice API-compatible drop-in replacement for
std::string.  However, std::string defines hash functions, so that it can be
used with unordered_xxx out of the box.  Currently, the versatile string
classes do not, so code which works with std::string fails with
__gnu_cxx::__vstring, with an error like:

...
undefined reference to `std::hash<__gnu_cxx::__versa_string, std::allocator, __gnu_cxx::__sso_string_base>
>::operator()(__gnu_cxx::__versa_string,
std::allocator, __gnu_cxx::__sso_string_base>) const'

I just replicated what's already being done in  in my
code, so presumably the same could be done in .