token_iterator flaw, format and date_time shadowing, regex gcc.mak problem, and Boost.Format suggestion

Hi, I have noted the following about Boost 1.32.0. 1. boost/token_iterator.hpp is very broken on line 34. template <class TokenizerFunc, class Iterator, class Type> class token_iterator : public iterator_facade< token_iterator<TokenizerFunc, Iterator, Type> , Type // ********** SHOULD READ: const Type , typename detail::minimum_category< forward_traversal_tag , typename iterator_traversal<Iterator>::type >::type , const Type& > GCC 3.4.2 refuses to compile this when broken. 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. 5. libs/regex/build/gcc.mak mentions '-I../../../' twice. This breaks compilation on MinGW. '-I../../..' ought to work everywhere (it does on MinGW). 6. Suggestion: It would be useful if Boost.Format were capable of delayed evaluation. int main() { format mommy("%1% %1%"); format kiddy("x%1%y"); mommy % kiddy; kiddy % 10; cout << mommy << endl; } Thanks, Stephan T. Lavavej

From: "Stephan T. Lavavej" <stl@nuwen.net>
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@sig.com Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;

"Stephan T. Lavavej" <stl@nuwen.net> writes:
Hi,
I have noted the following about Boost 1.32.0.
1. boost/token_iterator.hpp is very broken on line 34.
template <class TokenizerFunc, class Iterator, class Type> class token_iterator : public iterator_facade< token_iterator<TokenizerFunc, Iterator, Type> , Type // ********** SHOULD READ: const Type
Why do you think so?
, typename detail::minimum_category< forward_traversal_tag , typename iterator_traversal<Iterator>::type >::type , const Type& >
-- Dave Abrahams Boost Consulting www.boost-consulting.com

On Wed, 27 Jul 2005 00:59:50 -0700, Stephan T. Lavavej wrote:
Hi,
I have noted the following about Boost 1.32.0.
...
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.
Shadowing is already on the todo list, and has boon for some time. Other projects have pushed it to the back burner. Since this should be an easy fix, I'm hopeful we'll get to it soon. Thanks for the reminder, Bart
participants (4)
-
Bart
-
David Abrahams
-
Rob Stewart
-
Stephan T. Lavavej