joel wrote:
Eric Niebler wrote:
I don't know. Try telling me again what you're trying to do.
note to self: don't post without coffee first v_v
I should match : char, float, char*..* or float*..* , pointer being any
level of indirection
Try this:
#include
#include
namespace mpl = boost::mpl;
namespace proto = boost::proto;
template<typename T>
struct is_ok : mpl::false_ {};
template<>
struct is_ok<char> : mpl::true_ {};
template<>
struct is_ok<float> : mpl::true_ {};
template<typename T>
struct is_ok : is_ok<T> {};
struct IsOK
: proto::and_<
proto::terminalproto::_
, proto::if_proto::_value()>
>
{};
int main()
{
BOOST_MPL_ASSERT((
proto::matches));
BOOST_MPL_ASSERT((
proto::matches));
BOOST_MPL_ASSERT((
proto::matches::type, IsOK>));
BOOST_MPL_ASSERT((
proto::matches::type, IsOK>));
BOOST_MPL_ASSERT_NOT((
proto::matches));
BOOST_MPL_ASSERT_NOT((
proto::matches::type, IsOK>));
return 0;
}
--
Eric Niebler
BoostPro Computing
http://www.boostpro.com