diff --git a/ChangeLog b/ChangeLog index e56ad90..079e7c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,7 +26,7 @@ TODO (known issues): (all refer to phoenix though not all may be in fact phoenix bugs #9291, #9260, #8820, #8800 #8564, #8558, #8504, #8298, #8187, #8156, #7996 -#7953, #7946, #7730, #7481, #7480, #7423 +#7953, #7946, #7481, #7480, #7423 #7391, #7356, #6911, #6848, #6202, #6133, #6026, #5687 - Feature requests @@ -49,6 +49,9 @@ CHANGELOG - Fixed #8704 Using Phoenix lambdas on top of custom Proto expressions This works for C++11 only. Test cmath applies to this. +- Fixed #7730 Generic specializations of is_nullary for custom terminals are not possible + Define BOOST_PHOENIX_SPECIALIZE_CUSTOM_TERMINAL to use this. + Test bug7730 tests this. - Fixed #7624 Deduction failure This works for C++11 and has a workaround for C++03 Test bug7624 tests both versions. diff --git a/include/boost/phoenix/core/is_nullary.hpp b/include/boost/phoenix/core/is_nullary.hpp index 509c4d2..f90a043 100644 --- a/include/boost/phoenix/core/is_nullary.hpp +++ b/include/boost/phoenix/core/is_nullary.hpp @@ -137,12 +137,20 @@ namespace boost { namespace phoenix struct is_nullary : is_nullary {}; - + +#ifdef BOOST_PHOENIX_SPECIALIZE_CUSTOM_TERMINAL + template + struct is_nullary, + typename custom_terminal::_is_default_custom_terminal > + : mpl::true_ + {}; +#else template struct is_nullary > : mpl::true_ {}; - +#endif + template struct is_nullary > > : evaluator diff --git a/include/boost/phoenix/core/terminal.hpp b/include/boost/phoenix/core/terminal.hpp index 79ebe64..726694f 100644 --- a/include/boost/phoenix/core/terminal.hpp +++ b/include/boost/phoenix/core/terminal.hpp @@ -48,7 +48,13 @@ namespace boost { namespace phoenix : mpl::false_ {}; template - struct custom_terminal; + struct custom_terminal +#ifdef BOOST_PHOENIX_SPECIALIZE_CUSTOM_TERMINAL + { + typedef void _is_default_custom_terminal; // suggested fix for #7730 + } +#endif + ; namespace expression { diff --git a/test/Jamfile b/test/Jamfile index 5a3b525..5e59719 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -166,6 +166,7 @@ test-suite phoenix_include : [ run include/core/nothing.cpp ] [ run include/core/reference.cpp ] [ run include/core/terminal.cpp ] + [ run include/core/bug7730.cpp ] [ run include/core/value.cpp ] [ run include/core/visit_each.cpp ] [ run include/function/function.cpp : : : : function_function ] diff --git a/test/include/core/bug7730.cpp b/test/include/core/bug7730.cpp new file mode 100644 index 0000000..7df697c --- /dev/null +++ b/test/include/core/bug7730.cpp @@ -0,0 +1,8 @@ +/*============================================================================= + Copyright (c) 2011 Thomas Heller + 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) +==============================================================================*/ +#define BOOST_PHOENIX_SPECIALIZE_CUSTOM_TERMINAL +#include +int main() {}