stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Pevtsov" <>
Subject RE: test for 21.strings.capacity
Date Thu, 09 Mar 2006 16:27:35 GMT
I add the UserChar case into the test for 21.strings.capacity and
finally got the following linker error:

21_capacity error LNK2019: unresolved external symbol "public: static
struct UserChar * __cdecl UserTraits<struct UserChar>::assign(struct
UserChar *,unsigned int,struct UserChar)"
referenced in function "public: class std::basic_string<struct
UserChar,struct UserTraits<struct UserChar>,class std::allocator<struct
UserChar> > & __thiscall std::basic_string<struct UserChar,struct
UserTraits<struct UserChar>,class std::allocator<struct UserChar>
>::replace(unsigned int,unsigned int,unsigned int,struct UserChar)"

Windows, MSVC-7.1, 11d.
And I have the same error in Linux.

I'll investigate this, but the following sample fails to compile due to
the same error:

#include <string>
#include <rw_char.h>

int main (int argc, char** argv)
    UserChar tmp;
    std::basic_string<UserChar, UserTraits<UserChar>,
std::allocator<UserChar> > s (&tmp, 1);
    s.resize (10);

    return 0;

Without call to resize() it compiles successfully.

What do you think about this? 

Anton Pevtsov

-----Original Message-----
From: Martin Sebor [] 
Sent: Wednesday, March 08, 2006 19:50
Subject: Re: test for 21.strings.capacity

Martin Sebor wrote:
> Anton Pevtsov wrote:
>> The attached file contains the updated according to your notes 
>> version of the test for 21.string.capacity.
> Thanks! I committed this version here (I forgot that you can commit it

> yourself):
> This version still replaces the traits::eof() function even though 
> string doesn't make use of it. Could you take it out? In fact, since 
> we have our own UserTraits in rw_char.h, could you replace the 
> CharTraits class with it?

Never mind this. I made the changes myself in the commit below:

The UserTraits template also defines its own eof() but that's because
the template is also used in the iostreams tests where the function does
come in handy.


View raw message