Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2005-07-27 08:33:34


From: "Stephan T. Lavavej" <stl_at_[hidden]>
>
> I have noted the following about Boost 1.32.0.
>
> 2. boost/format/format_implementation.hpp contains shadowing on line 28. The
> constructor takes 'str', which is named identically to a member function.
>
> 3. boost/date_time/time_duration.hpp contains shadowing on line 53. The
> constructor takes 'hours', 'minutes', and 'seconds', which are named
> identically to member functions.
>
> 4. boost/date_time/time_system_counted.hpp contains shadowing on line 34.
> The constructor takes 'tod', which is named identically to a member
> function.
>
> Shadowing makes using Boost with GCC -Wshadow difficult, and these cases are
> very easy to fix.

I find that partitioning names is helpful. I use suffixes to
separate the names of formal parameters and data members from
other names. I don't distinguish between automatic variables and
member functions, however.

   - data members use a trailing underscore
   - formal parameters use a directional suffix: "_i," "_o," or
     "_io"

Some scheme like that could help the above libraries.

-- 
Rob Stewart                           stewart_at_[hidden]
Software Engineer                     http://www.sig.com
Susquehanna International Group, LLP  using std::disclaimer;

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