Boost logo

Boost :

From: Eric Friedman (ebf_at_[hidden])
Date: 2003-11-16 20:03:21


David Abrahams wrote:

> Eric Friedman <ebf_at_[hidden]> writes:
[snip]
>>Additionally, lambda_match supports more advanced functionality, such as
>>
>> template <class Double>
>> typename enable_if<
>> mpl::lambda_match< std::pair<_1,_1>, Double >
>> >::type
>> f( Double & d );
>>
>>Perhaps I should rename it to mpl::is_instance_of?
>
>
> I rather like
>
> mpl::pattern_match
>
> Of course, next you'll have to be able to return an integral constant
> wrapper which rates matches for closeness. IOW,
>
> mpl::pattern_match<std::pair<int,int>, std::pair<int,int> >::value == 3
> mpl::pattern_match<std::pair<int,_1>, std::pair<int,int> >::value == 2
> mpl::pattern_match<std::pair<_1,_1>, std::pair<int,int> >::value == 2
> mpl::pattern_match<std::pair<_1,_2>, std::pair<int,int> >::value == 1
>
> or something ;-)

Probably doable, but what use-case do you have in mind?

Eric


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk