Boost logo

Boost Users :

From: Samuel Landau (samuel.landau_at_[hidden])
Date: 2005-10-27 07:19:18


Hello,

I am trying Boost 1.33 ptr_container with GCC 4.0.1 on Linux.
When including a ptr_container header (say, ptr_vector.hpp),
compiling code with the "-Wshadow" flag, some warnings are
issued about shadowed members. I am wondering if this might be a
problem, even if my snippet code compiles and seems to run fine
so far for me.

output example (with boost/ in current directory) :

$ cat main.cpp
#include <boost/ptr_container/ptr_vector.hpp>
int main() {}
$ g++ -I. -Wshadow main.cpp
./boost/ptr_container/detail/move.hpp: In constructor
'boost::ptr_container_detail::move_ptrs::move_source<Ptr>::move_source(Ptr&)':
./boost/ptr_container/detail/move.hpp:18: warning: declaration of 'ptr'
shadows a member of 'this'
./boost/ptr_container/detail/static_move_ptr.hpp: In member function
'void boost::ptr_container_detail::static_move_ptr<T,
Deleter>::check(const
+boost::ptr_container_detail::static_move_ptr<TT, DD>&)':
./boost/ptr_container/detail/static_move_ptr.hpp:156: warning:
declaration of 'ptr' shadows a member of 'this'
./boost/ptr_container/exception.hpp: In constructor
'boost::bad_ptr_container_operation::bad_ptr_container_operation(const
char*)':
./boost/ptr_container/exception.hpp:27: warning: declaration of 'what'
shadows a member of 'this'
./boost/ptr_container/exception.hpp: In constructor
'boost::bad_index::bad_index(const char*)':
./boost/ptr_container/exception.hpp:41: warning: declaration of 'what'
shadows a member of 'this'
./boost/ptr_container/detail/reversible_ptr_container.hpp: In member
function 'ForwardIterator
+boost::ptr_container_detail::reversible_ptr_container<Config,
CloneAllocator>::advance(ForwardIterator, typename
Config::void_container_type::size_type)':
./boost/ptr_container/detail/reversible_ptr_container.hpp:287: warning:
declaration of 'begin' shadows a member of 'this'

-- 
Samuel Landau

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net