Opened 12 years ago

Closed 12 years ago

#4652 closed Bugs (invalid)

is_wrapper<std::string> assertion failed in xml_archive case

Reported by: kondo@… Owned by: Robert Ramey
Milestone: To Be Determined Component: serialization
Version: Boost 1.44.0 Severity: Problem
Keywords: Cc:

Description

When I serialize a class that includes std::string non intrusively, below error occurred.

'boost::mpl::assertion_failed' : Cannot convert 1st argument 'boost::mpl::failed boost::serialization::is_wrapper<T>::* *' to 'boost::mpl::assert<false>::type'.

T=const std::string

The error occurs only when I use the xml_archive. The text_archive has no problem.

I tried to fix my code. And I add below code.

BOOST_CLASS_IS_WRAPPER(std::string)

The error doesn't occur.

But I don't understand why should I use this macro. I guess it should care in the serialization library.

I attached the simple example to reproduce this problem.

Attachments (1)

str_wrap_err.cpp (1.4 KB ) - added by kondo@… 12 years ago.

Download all attachments as: .zip

Change History (3)

by kondo@…, 12 years ago

Attachment: str_wrap_err.cpp added

comment:1 by kondo@…, 12 years ago

Sorry, I made a very easy mistake.

I forgot BOOST_SERIALIZATION_NVP at str_wrap_err.cpp(27).

After fixing my code, The error doesn't occur.

Before

	ar & ms.s_;

After

	ar & BOOST_SERIALIZATION_NVP(ms.s_);

Please change the ticket status to invalid.

comment:2 by Steven Watanabe, 12 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.