Skip to content

Commit

Permalink
Fix Sun Studio related issue, reported by dariomt via boost-users list
Browse files Browse the repository at this point in the history
  • Loading branch information
apolukhin committed Jan 17, 2016
1 parent 038e80e commit abf7441
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions include/boost/lexical_cast/try_lexical_convert.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright Kevlin Henney, 2000-2005.
// Copyright Alexander Nasonov, 2006-2010.
// Copyright Antony Polukhin, 2011-2014.
// Copyright Antony Polukhin, 2011-2016.
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
Expand Down Expand Up @@ -57,8 +57,15 @@ namespace boost {
: boost::true_type
{};

// Sun Studion has problem with partial specialization of templates differing only in namespace.
// We workaround that by making `is_booststring` trait, instead of specializing `is_stdstring` for `boost::container::basic_string`.
template<typename T>
struct is_booststring
: boost::false_type
{};

template<typename CharT, typename Traits, typename Alloc>
struct is_stdstring< boost::container::basic_string<CharT, Traits, Alloc> >
struct is_booststring< boost::container::basic_string<CharT, Traits, Alloc> >
: boost::true_type
{};

Expand Down Expand Up @@ -153,7 +160,7 @@ namespace boost {
boost::detail::is_char_array_to_stdstring<Target, src >::value ||
(
boost::is_same<Target, src >::value &&
boost::detail::is_stdstring<Target >::value
(boost::detail::is_stdstring<Target >::value || boost::detail::is_booststring<Target >::value)
) ||
(
boost::is_same<Target, src >::value &&
Expand Down

0 comments on commit abf7441

Please sign in to comment.