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)"
([EMAIL PROTECTED]@UUserChar@@@@SAPAUUserChar@@[EMAIL PROTECTED]@@Z)
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)"
([EMAIL PROTECTED]@UUserChar@@[EMAIL PROTECTED]@@@@V?$alloca
[EMAIL PROTECTED]@@@std@@@std@@[EMAIL PROTECTED]@@@Z)
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?
Thanks,
Anton Pevtsov
-----Original Message-----
From: Martin Sebor [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 08, 2006 19:50
To: [email protected]
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): http://svn.apache.org/viewcvs?rev=384007&view=rev.
>
> 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:
http://svn.apache.org/viewcvs.cgi?rev=384084&view=rev
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.
Martin