You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Anton Pevtsov <an...@moscow.vdiweb.com> on 2006/02/21 17:15:26 UTC

test for lib.accumulate

The attached file contains the test for the lib.accumulate algorithm. 

Here I implemented new class Y derived from X and add the += operator
into it. May be, it would be useful to extend this class with operator *
(for the inner_product testing) and move it to alg_base header. Also, it
would be useful to have "primitive" templates with += and *= operators
(as an analogue of assign<>). 

Martin, what do you think about it?

With best wishes,
Anton Pevtsov


Re: test for lib.accumulate

Posted by Martin Sebor <se...@roguewave.com>.
Anton Pevtsov wrote:
> The attached file contains the test for the lib.accumulate algorithm.
> Here I implemented new class Y derived from X and add the += operator
> into it.

Looks good, thanks. I just made a few minor changes to it, such
as replacing the tricky operator new business with a straight
(but still dynamically allocated) array, and the _RWSTD_SIZE_T
macro with the std::size_t type. The macro is used in library
and test suite headers to prevent namespace pollution, but there
is no need for it here.

Committed thus:
http://svn.apache.org/viewcvs?rev=379649&view=rev

Btw., it would be good to reduce the amount of templates in the
new tests like we recently started doing. It really does make
a difference in the compilation time.


> May be, it would be useful to extend this class with operator *
> (for the inner_product testing) and move it to alg_base header.

Yeah, I think that may not be a bad idea. Let me look into it some.

> Also, it
> would be useful to have "primitive" templates with += and *= operators
> (as an analogue of assign<>).
> Martin, what do you think about it?

Yes, if there's a need for such things in other tests it would make
sense to move them to a common header. We already need to do that
with the Less functor that's duplicated in many tests.

Martin