[C++-sig] Re: std::string assignment problem

David Abrahams dave at boost-consulting.com
Tue Dec 9 05:12:33 CET 2003


"Jinseok Seo" <jsseo at postech.ac.kr> writes:

> Hello.
>
> When I passed a string parameter that is longer than 15,
> the program hals with the following assertion failed error message.
                        ^^^^^^^^^^^^^

You left out the message.

> The error occured only when I built the project for "Debug" mode.
> (compiler: Microsoft Visual Studio .NET 2003)
>
> For example, in python interpreter,
>
> from ex1 import * <-- ok
> e = Ex("1234567890123456") <-- error
> e = Ex("123456789012345") <-- ok
> e.name = "1234567890123456" <-- error
> e.name = "123456789012345" name = name;
> }
> void Ex1::setName(std::string name) {
> this->name = name;
> }

Can you post a complete, minimal example which reproduces the problem?

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com





More information about the Cplusplus-sig mailing list