You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Liviu Nicoara <ni...@roguewave.com> on 2006/01/17 21:23:55 UTC

naming convention

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?

Thanks,
Liviu

Re: naming convention

Posted by Martin Sebor <se...@roguewave.com>.
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.

Martin