PATCH: use construct and destroy from user-provided allocators
Matt Austern
austern@apple.com
Tue Jul 27 17:09:00 GMT 2004
On Jul 27, 2004, at 9:04 AM, Benjamin Kosnik wrote:
>
> I agree with Gaby, this looks great.
>
> The testcases, however, might be improved by putting the check function
> into testsuite_allocator.h: we try to avoid code duplication as much as
> possible by moving test framework bits into the testsuite includes, as
> inconceivable as it may seem. (And maybe name this common function
> something more descriptive, like check_construct_destroy or whatever.)
> You might want to consider naming the test files after whatever the
> final function name is, instead of allocator1.cc. In addition, usually
> we try to return zero from main, and use VERIFY or assert() to check
> correctness.
The only one of these comments I have a problem with is the last
one. I thought aboutusing VERIFY and deliberately decided against
it. Rationale: if I've got multiple failures I want to see them all.
Using
VERIFY means I'll get an abort after the first failure.
But I'll fix the other problems you pointed out, and then check this
in in a couple days.
--Matt
More information about the Libstdc++
mailing list