Boost logo

Boost :

Subject: Re: [boost] [context] boost::ctx::?
From: Eric Niebler (eric_at_[hidden])
Date: 2012-09-14 10:55:25

On 9/14/2012 10:42 AM, Greg Rubino wrote:
> On Fri, Sep 14, 2012 at 10:22 AM, Dave Abrahams <dave_at_[hidden]> wrote:
>> ctx seems like a needlessly short abbreviation. Wouldn't it be better
>> and more consistent with the rest of Boost to ask users to write
>> using namespace ctx = boost::context;
>> if they want something short?
> I was thinking the same thing actually. +1
> AFAICT, it seems like the general convention is that if the name of the
> library is Boost.Beetlejuice, then the namespace will be
> boost::beetlejuice. The word 'context' isn't really long enough to justify
> breaking that tradition IMO.

Amazingly, we actually have a published convention for these things. :-)

'The library is given a name that describes the contents of the library.
Cryptic abbreviations are strongly discouraged. Following the practice
of the C++ Standard Library, names are usually singular rather than
plural. For example, a library dealing with file systems might chose the
name "filesystem", but not "filesystems", "fs" or "nicecode".'

It goes on to say that if there is a class or function of the same name
as the library (boost::tuple), the name should be pluralized (e.g.
boost::tuples::tuple, but tuple isn't in it's own namespace so it's moot
in this case).

So, if there already is a component boost::ctx::context, or if you would
like to leave that door open, the namespace should be "boost::contexts".
Otherwise, the namespace should be "boost::context", IMO.


Eric Niebler
BoostPro Computing

Boost list run by bdawes at, gregod at, cpdaniel at, john at