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/16 17:11:18 UTC

test for lib.set.intersection

The attached file contains the test for the lib.set.intersection
algorithm. 

With best wishes,
Anton Pevtsov


Re: test for lib.set.intersection

Posted by Martin Sebor <se...@roguewave.com>.
Anton Pevtsov wrote:
> The attached file contains the test for the lib.set.intersection
> algorithm.

Thank you. Committed thus:
http://svn.apache.org/viewcvs.cgi?rev=378555&view=rev

[...]
> struct SetIntersectionTestBase
> {
>     virtual ~SetIntersectionTestBase() {}
> 
>     const char* iter_names [3];
> 
>     // invokes set_intersection
>     virtual X*
>     set_intersection (const X*, const X*, const X*, const X*, 
>                       X*, X*, const Less*) const {
>         RW_ASSERT (!"test logic error");

FYI: there is no need to provide a definition for a virtual function
in the base class as long as it is overridden in the base class. In
cases when the function must be overridden it's better to make it
pure virtual. (The reason 25.merge.cpp does define the virtual
functions in the base rather than make them pure is because each
derived class overrides only one of the two functions; the one that
is not overridden is not called on the object that doesn't override
it).

Martin