|
Boost : |
From: helmut.zeisel_at_[hidden]
Date: 2001-08-24 15:39:43
--- In boost_at_y..., helmut.zeisel_at_a... wrote:
>
> template<typename T> struct seminumerical_traits
> {
> typedef default_tag is_zero_tag;
> typedef default_tag is_positive_tag;
> typedef default_tag is_odd_tag;
> ...
> };
>
...
>
> // General interface
> template<typename T> bool is_zero(const T& t)
> {
> return is_zero(t, typename T::is_zero_tag());
this should be
return is_zero(t, typename seminumerical_traits<T>::is_zero_tag())
Usage is now
int i;
unlimited j;
is_zero(i); // expands to i==0
is_zero(j); // expands to j.is_zero();
Helmut
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk