|
Boost : |
From: helmut.zeisel_at_[hidden]
Date: 2001-08-29 14:37:13
--- In boost_at_y..., Douglas Gregor <gregod_at_c...> wrote:
>
> It makes sense to make the algorithm work at its natural level of
> abstraction. If a Euclidean ring is the algebraic structure on which
the
> algorithm is defined, then it should work for all Euclidean rings.
>
> Additionally, I think it does make sense to use a static assert in
this case,
> especially because a Euclidean ring is a sufficiently rich
algebraic
> structure that not all algebraic types conform to.
>
> What I'm saying is that the
>
> ::boost::extensible_traits<is_euclidian_ring_tag, T>::value
>
> approach can get very unweildy. If I have a type Foo that models a
Euclidean
> ring, I don't want to specialize extensible traits for the tags:
> euclidean_ring_tag
> ring_tag
> semiring_tag
> abelian_group_tag
> group_tag
> abelian_monoid_tag
> monoid_tag
>
I agree to all three points.
The problem is, however, that to my current knowledge
I do not know a solution that satisfies all three points
simultanously.
In my personal preferences, I would drop the static
assertion -
if a class offers a %= operator
in the usual semantics,
there are good chances that it is already an Euclidian ring,
so we have already a compile time check for the most usual cases.
I, however, do not know the preferences of other people.
Maybe someone has a great idea how to satisfy all three points.
Helmut
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk