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:
@@ -73,7 +73,6 @@ namespace boost { namespace spirit
|
|||||||
( right_align )
|
( right_align )
|
||||||
( center )
|
( center )
|
||||||
( maxwidth )
|
( maxwidth )
|
||||||
( confix )
|
|
||||||
( set_state )
|
( set_state )
|
||||||
( in_state )
|
( in_state )
|
||||||
( token )
|
( token )
|
||||||
|
|||||||
@@ -280,6 +280,7 @@ namespace boost { namespace spirit
|
|||||||
type;
|
type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// FIXME: we need to change this to conform to the result_of protocol
|
||||||
template <
|
template <
|
||||||
typename A0
|
typename A0
|
||||||
, typename A1 = unused_type
|
, typename A1 = unused_type
|
||||||
@@ -295,7 +296,6 @@ namespace boost { namespace spirit
|
|||||||
type;
|
type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Note: in the following overloads, SFINAE cannot
|
// Note: in the following overloads, SFINAE cannot
|
||||||
// be done on return type because of gcc bug #24915:
|
// be done on return type because of gcc bug #24915:
|
||||||
// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=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
|
// Calculate the type of the compound terminal if generated by one of
|
||||||
// the spirit::terminal::operator() overloads above
|
// 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
|
// The terminal type itself is passed through without modification
|
||||||
template <typename Tag>
|
template <typename Tag>
|
||||||
struct terminal<Tag, unused_type, unused_type, unused_type>
|
struct terminal<Tag()>
|
||||||
{
|
{
|
||||||
typedef spirit::terminal<Tag> type;
|
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;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user