|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-08-25 15:32:50
From: <scleary_at_[hidden]>
> Hmm. I don't see a really good solution from either of these. This
> is just an explanation of the problem, as I see it: how can we
> provide a 'traits' concept that allows the adding of user traits?
template<class Tag, class A> struct extensible_traits;
struct is_even_tag {};
template<class Int> struct extensible_traits<is_even_tag, Int>
{
typedef bool result_type;
static result_type f(Int i) { return i % 2 == 0; }
};
?
-- Peter Dimov Multi Media Ltd.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk