Boost logo

Boost :

From: Reece Dunn (msclrhd_at_[hidden])
Date: 2004-02-18 12:23:29

Stefan Slapeta wrote:
>Pavol Droba wrote:
>>It is not really reasonable to await from
>> a user to always type boost::algorithm::string::trim.
>Maybe it could help a little bit to replace 'algorithm' by 'algo' and
>'string' by 'str'.
>IMHO, also shorter namespaces like 'boost::filesystem' have the problem of
>beeing too long to be used on every access. Long typenames like
>boost::filesystem::directory_iterator have a very high capability to make
>the code unreadable very quickly.

why not use:
   namespace sa = boost::algorithm::string;
   sa::trim( ... );
   namespace fs = boost::filesystem;
   fs::directory_iterator di = ...;

Surely this gives you what you are after (shorter namespace names) without
modifying the namespace currently used by the library (which will break
existing code that uses the libraries).

This is what namespace aliases are for and is used for the filesystem
library in the regression test implementation.


It's fast, it's easy and it's free. Get MSN Messenger today!

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