Opened 15 years ago

Closed 15 years ago

#961 closed Bugs (worksforme)

boost::basic_binary_oprimitive not instantiated correctly

Reported by: theta682@… Owned by: Robert Ramey
Milestone: Boost 1.35.0 Component: serialization
Version: Boost 1.34.0 Severity: Problem
Keywords: Cc:

Description

template<class Archive, class Elem, class Tr>
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
basic_binary_oprimitive<Archive, Elem, Tr>::save(const std::wstring &ws);

template<class Archive, class Elem, class Tr>
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
basic_binary_iprimitive<Archive, Elem, Tr>::load(std::wstring & ws);

are not instantiated for boost::binary_oarchive and boost:binary_iarchive (wchar functions for char archives).

Change History (7)

comment:1 by Thomas Witt, 15 years ago

Milestone: Boost 1.34.1Boost 1.35.0
Severity: Showstopper

Changed milestone to 1.35.0 per request from Robert Ramey.

comment:2 by Dave Abrahams, 15 years ago

Owner: set to Robert Ramey

comment:3 by theta682@…, 15 years ago

Any news? Will it be fixed in 1.35.0?

comment:4 by Robert Ramey, 15 years ago

Severity: ShowstopperProblem
Status: newassigned

Hmmm - these are implemented as primitives in basic_binary_?primitive.hpp (iff the compiler supports wide character strings). Derived classes forward to there so I can't see where there should be a problem.

comment:5 by theta682@…, 15 years ago

There are template functions for wchar_t, but they are not instantiated implicitly. I have to apply this patch:

Index: C:/Projects/contrib/boost-1.34.1/libs/serialization/src/binary_iarchive.cpp =================================================================== --- C:/Projects/contrib/boost-1.34.1/libs/serialization/src/binary_iarchive.cpp (revision 33976) +++ C:/Projects/contrib/boost-1.34.1/libs/serialization/src/binary_iarchive.cpp (revision 33977) @@ -26,6 +26,11 @@

char, std::char_traits<char>

;

+#ifndef BOOST_NO_STD_WSTRING +template<class Archive, class Elem, class Tr> +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_binary_iprimitive<Archive, Elem, Tr>::load(std::wstring & ws); +#endif

template class basic_binary_iarchive<binary_iarchive> ; template class binary_iarchive_impl<

binary_iarchive,

Index: C:/Projects/contrib/boost-1.34.1/libs/serialization/src/binary_oarchive.cpp =================================================================== --- C:/Projects/contrib/boost-1.34.1/libs/serialization/src/binary_oarchive.cpp (revision 33976) +++ C:/Projects/contrib/boost-1.34.1/libs/serialization/src/binary_oarchive.cpp (revision 33977) @@ -26,6 +26,16 @@

char, std::char_traits<char>

;

+#ifndef BOOST_NO_CWCHAR +template<class Archive, class Elem, class Tr> +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_binary_oprimitive<Archive, Elem, Tr>::save(const wchar_t * ws); +#ifndef BOOST_NO_STD_WSTRING +template<class Archive, class Elem, class Tr> +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_binary_oprimitive<Archive, Elem, Tr>::save(const std::wstring &ws); +#endif +#endif

template class basic_binary_oarchive<binary_oarchive> ; template class binary_oarchive_impl<

binary_oarchive,

comment:6 by Robert Ramey, 15 years ago

a) I check the code and don't see why this should be necessary b) The serialization tests serialize wstring. See libs/serialization/test/A.hpp c) send me a small test case which should link but doesn't

Robert Ramey

comment:7 by Robert Ramey, 15 years ago

Resolution: worksforme
Status: assignedclosed
Note: See TracTickets for help on using tickets.