diff --git a/include/boost/fusion/support/tag_of.hpp b/include/boost/fusion/support/tag_of.hpp old mode 100644 new mode 100755 index 61cb3b19..f9e57856 --- a/include/boost/fusion/support/tag_of.hpp +++ b/include/boost/fusion/support/tag_of.hpp @@ -48,11 +48,17 @@ namespace boost { namespace fusion { BOOST_MPL_HAS_XXX_TRAIT_DEF(fusion_tag) + template + struct tag_of_fallback + { + typedef non_fusion_tag type; + }; + template struct tag_of_impl : mpl::if_, mpl::identity, - mpl::identity >::type + mpl::identity::type> >::type {}; template diff --git a/test/Jamfile b/test/Jamfile old mode 100644 new mode 100755 index 13dd35c5..21944f24 --- a/test/Jamfile +++ b/test/Jamfile @@ -271,6 +271,7 @@ project : [ requires cxx11_variadic_templates ] ] [ compile support/tag_of.cpp ] [ compile support/unused.cpp ] + [ compile support/detail/tag_of_fallback.cpp ] # [ compile-fail xxx.cpp ] diff --git a/test/support/detail/tag_of_fallback.cpp b/test/support/detail/tag_of_fallback.cpp new file mode 100755 index 00000000..996e6dc3 --- /dev/null +++ b/test/support/detail/tag_of_fallback.cpp @@ -0,0 +1,50 @@ +/*============================================================================= + Copyright (c) 2022 Denis Mikhailov + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#include +#include +#include +#include +#include +#include + +namespace mpl = boost::mpl; + +template +struct my_is_implicitly_reflectable; + +namespace boost { namespace fusion +{ + struct boost_my_reflectable_tag; + namespace detail + { + template + struct tag_of_fallback >::type> + { + typedef typename mpl::if_ + , boost_my_reflectable_tag + , non_fusion_tag + >::type type; + }; + } +}} + +struct reflectable {}; +struct non_reflectable {}; + +template +struct my_is_implicitly_reflectable : mpl::false_ {}; +template<> +struct my_is_implicitly_reflectable : mpl::true_ {}; + +typedef boost::fusion::traits::tag_of::type ReflectableTag; +typedef boost::fusion::traits::tag_of::type NonReflectableTag; +BOOST_STATIC_ASSERT((boost::is_same::value)); +BOOST_STATIC_ASSERT((boost::is_same::value)); + +int +main() { } +