2
0
mirror of https://github.com/boostorg/spirit.git synced 2026-01-19 04:42:11 +00:00

Spirit: Applied some changes to the result_of::terminal metafunction.

[SVN r52685]
This commit is contained in:
Hartmut Kaiser
2009-04-30 17:05:29 +00:00
parent 0e269c620b
commit fbfd74fc17
2 changed files with 27 additions and 15 deletions

View File

@@ -73,7 +73,6 @@ namespace boost { namespace spirit
( right_align )
( center )
( maxwidth )
( confix )
( set_state )
( in_state )
( token )

View File

@@ -280,6 +280,7 @@ namespace boost { namespace spirit
type;
};
// FIXME: we need to change this to conform to the result_of protocol
template <
typename A0
, typename A1 = unused_type
@@ -295,7 +296,6 @@ namespace boost { namespace spirit
type;
};
// Note: in the following overloads, SFINAE cannot
// be done on return type because of gcc bug #24915:
// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24915
@@ -388,28 +388,41 @@ namespace boost { namespace spirit
};
///////////////////////////////////////////////////////////////////////////
namespace traits
namespace result_of
{
template <typename Sig>
struct terminal;
// Calculate the type of the compound terminal if generated by one of
// the spirit::terminal::operator() overloads above
template <
typename Tag
, typename A0 = unused_type
, typename A1 = unused_type
, typename A2 = unused_type
>
struct terminal
{
typedef typename spirit::terminal<Tag>::
template result<A0, A1, A2>::type type;
};
// The terminal type itself is passed through without modification
template <typename Tag>
struct terminal<Tag, unused_type, unused_type, unused_type>
struct terminal<Tag()>
{
typedef spirit::terminal<Tag> type;
};
template <typename Tag, typename A0>
struct terminal<Tag(A0)>
{
typedef typename spirit::terminal<Tag>::
template result<A0>::type type;
};
template <typename Tag, typename A0, typename A1>
struct terminal<Tag(A0, A1)>
{
typedef typename spirit::terminal<Tag>::
template result<A0, A1>::type type;
};
template <typename Tag, typename A0, typename A1, typename A2>
struct terminal<Tag(A0, A1, A2)>
{
typedef typename spirit::terminal<Tag>::
template result<A0, A1, A2>::type type;
};
}
}}