|
Boost Users : |
Subject: [Boost-users] [Boost.LexicalCast] problem with 1.59 in Solaris
From: dariomt_at_[hidden]
Date: 2015-12-22 13:31:29
Trying to compile file libs/date_time/src/gregorian/greg_month.cpp I get an
error related to Boost.LexicalCast.
I have reduced the problem to a minimal test case:
#include <string>
#include <boost/lexical_cast.hpp>
void f(const char* s)
{
std::string s1(boost::lexical_cast<std::string>(s));
}
My feeling is that this compiler has problems in the specializations for
boost::detail::is_stdstring and boost::detail::is_char_array_to_stdstring.
If I remove all those specializations the error goes away. I assume this is
not the perfect solution because I guess this will miss some optimization
of lexical_cast, but at least I can compile it this way :(
Is there a better solution for this?
Has this problem been fixed in 1.60?
Error message (full instantiation stack available if needed):
"/ThirdPartyLibs/boost/1_59_0/boost/lexical_cast/try_lexical_convert.hpp",
line 146: Error: Ambiguous partial specialization for
boost::detail::is_char_array_to_stdstring<std::string, const char*>,
boost::detail::is_char_array_to_stdstring<boost::container::basic_string<boost::detail::CharT,
boost::detail::Traits, boost::detail::Alloc>, const boost::detail::CharT*>
and
boost::detail::is_char_array_to_stdstring<std::basic_string<boost::detail::CharT,
boost::detail::Traits, boost::detail::Alloc>, const boost::detail::CharT*>.
"/ThirdPartyLibs/boost/1_59_0/boost/lexical_cast.hpp", line 42: Where:
While instantiating
"boost::conversion::detail::try_lexical_convert<std::string, const
char*>(const char*const&, std::string &)".
"/ThirdPartyLibs/boost/1_59_0/boost/lexical_cast/try_lexical_convert.hpp",
line 134: Error: Ambiguous partial specialization for
boost::detail::is_stdstring<std::string>,
boost::detail::is_stdstring<boost::container::basic_string<boost::detail::CharT,
boost::detail::Traits, boost::detail::Alloc>> and
boost::detail::is_stdstring<std::basic_string<boost::detail::CharT,
boost::detail::Traits, boost::detail::Alloc>>.
"/ThirdPartyLibs/boost/1_59_0/boost/lexical_cast.hpp", line 42: Where:
While instantiating
"boost::conversion::detail::try_lexical_convert<std::string, const
char*>(const char*const&, std::string &)".
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net