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( ... );
or
   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.

Regards,
Reece

_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today!
http://www.msn.co.uk/messenger


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk