Anton Pevtsov wrote:
The attached file contains my attempt to update lib.alg.unique tests and
port them to new test driver.

Looks good, thanks! I committed it with just a few minor modifications
mostly to improve the readability of the code with this change:
http://svn.apache.org/viewcvs.cgi?rev=372633&view=rev

A few points on the changes I madet to your version:

*  It helps to separate function arguments one per line whenever there
   are more than two or three of them; it also help to line up their
   names.

*  It helps to line up like local variables and their initializers,
   such as the iterators, to immediately see the differences between
   them.

*  It's not necessary to cast the arguments to the iterator ctors
   to the target type since the type is explicitly provided in the
   name of the iterator (e.g., InputIter<X> iter (0, 0, 0) is good
   enough).

*  It's important to end every statement with a semicolon on the
   same line. Specifically, a macro definition should not end with
   a semicolon so that the the semicolon can and must be supplied
   when invoking the macro. (Otherwise Emacs formatting gets messed
   up.)

*  It helps to introduce helper variables for complicated-looking
   repeatedly used expressions (such as InputIter<T>(0, 0, 0)).

*  Please avoid gratuitous spaces in expressions such as (T*)0.
   I.e., do not write "(T*) 0."

Thanks again!
Martin

Reply via email to