Boost logo

Boost Users :

Subject: Re: [Boost-users] [function] generalization of std::plus and std::multiplies with more than one argument type
From: Joel Falcou (joel.falcou_at_[hidden])
Date: 2009-10-22 02:00:18


alfC wrote:
> thank you, where I can find Boost.SIMD, is functor defined there?
Boost.SIMD is currently under work and will be released to the vault "soon"

> is this "plus" the same as "std::plus"? If so how can x, y be of
> different type?

no, this plus is a tag defined by the library. x and y are from
different type and i use a tag dispatching method to discriminate the
actual semantic of plus to use. Basically, I scan the argument list and
try to find non trivial types, if i do i ask for a specific properties
called tag_of on those types and select the implementation to use to
perform the operation. Currently we support arithmetic types and SIMD
types but we provide an extension mecanism so you can define your own
type set and give them proper implementation (for ex., complex number,
matrix etc). All those variation are called by the same functor call
anyway, making it a pure generic tag-dispatched computation facility.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net