stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <>
Subject Re: naming convention
Date Tue, 17 Jan 2006 20:44:28 GMT
Liviu Nicoara wrote:
> Martin,
> I am working on the strings.cons test now and I am fiddling with the
> replacement op new/delete support in the driver.
> So, the naming convention calls for _rw_ for all functions in the driver
> (including those with internal linkage) and rw_ for all types defined in
> the driver?

I'm glad you ask :) The convention I've been trying to follow in
the driver is:

   rw_xxx for public names of functions (such as rw_assert())
   rw_xxx_t for public names of types (such as rw_any_t defined
   in any.h)

   _rw_xxx for private names of functions (such as _rw_vdiag()
   defined in driver.cpp)

where public is defined as visible in the tests, and private as hidden.
Most hidden symbols have internal linkage (i.e., are declared static)
but there are some that need to have external linkage (e.g., those that
are referenced from templates) and this convention helps prevent symbol
collisions with names defined in the tests.

There are also a bunch of names defined in alg_test.h that don't follow
this convention. We should probably review them and try to make them
consistent wherever it makes sense. Where I'm sure it will make sense
is for the iterators (InputIter, etc.) and names of other types that
parallel the names of the template parameters used in the STL (such
as the recently added Size template). We might have to consider these
on a case-by-case basis.


View raw message