diff options
Diffstat (limited to 'boost/variant/polymorphic_get.hpp')
-rw-r--r-- | boost/variant/polymorphic_get.hpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/boost/variant/polymorphic_get.hpp b/boost/variant/polymorphic_get.hpp index 89fca36de7..1a98382be6 100644 --- a/boost/variant/polymorphic_get.hpp +++ b/boost/variant/polymorphic_get.hpp @@ -3,7 +3,7 @@ // See http://www.boost.org for updates, documentation, and revision history. //----------------------------------------------------------------------------- // -// Copyright (c) 2013-2015 Antony Polukhin +// Copyright (c) 2013-2017 Antony Polukhin // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at @@ -113,13 +113,15 @@ public: // visitor interfaces template <typename U> pointer operator()(U& operand) const BOOST_NOEXCEPT { + typedef typename boost::remove_reference<Base>::type base_t; typedef boost::integral_constant< bool, - boost::mpl::or_< - boost::is_base_of<Base, U>, - boost::is_same<Base, U>, - boost::is_same<typename boost::remove_cv<Base>::type, U > - >::value + ( + boost::is_base_of<base_t, U>::value && + (boost::is_const<base_t>::value || !boost::is_const<U>::value) + ) + || boost::is_same<base_t, U>::value + || boost::is_same<typename boost::remove_cv<base_t>::type, U >::value > tag_t; return this_type::get(operand, tag_t()); |