После исправления проблемы с инициализацией weight предупреждения по-прежнему будут появляться при компиляции с boost 1.58 и -std=gnu++11: палочка
In file included from /usr/local/boost-1.59.0/include/boost/smart_ptr/shared_ptr.hpp:28:0,
from /usr/local/boost-1.59.0/include/boost/shared_ptr.hpp:17,
from /usr/local/boost-1.59.0/include/boost/property_map/vector_property_map.hpp:14,
from /usr/local/boost-1.59.0/include/boost/property_map/property_map.hpp:600,
from /usr/local/boost-1.59.0/include/boost/graph/properties.hpp:19,
from /usr/local/boost-1.59.0/include/boost/graph/compressed_sparse_row_graph.hpp:26,
from prog.cc:2:
/usr/local/boost-1.59.0/include/boost/smart_ptr/detail/shared_count.hpp:396:33: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
explicit shared_count( std::auto_ptr<Y> & r ): pi_( new sp_counted_impl_p<Y>( r.get() ) )
^~~~~~~~
In file included from /usr/local/gcc-head/include/c++/7.0.0/memory:80:0,
from /usr/local/boost-1.59.0/include/boost/config/no_tr1/memory.hpp:21,
from /usr/local/boost-1.59.0/include/boost/smart_ptr/shared_ptr.hpp:23,
from /usr/local/boost-1.59.0/include/boost/shared_ptr.hpp:17,
from /usr/local/boost-1.59.0/include/boost/property_map/vector_property_map.hpp:14,
from /usr/local/boost-1.59.0/include/boost/property_map/property_map.hpp:600,
from /usr/local/boost-1.59.0/include/boost/graph/properties.hpp:19,
from /usr/local/boost-1.59.0/include/boost/graph/compressed_sparse_row_graph.hpp:26,
from prog.cc:2:
/usr/local/gcc-head/include/c++/7.0.0/bits/unique_ptr.h:51:28: note: declared here
template<typename> class auto_ptr;
^~~~~~~~
In file included from /usr/local/boost-1.59.0/include/boost/shared_ptr.hpp:17:0,
from /usr/local/boost-1.59.0/include/boost/property_map/vector_property_map.hpp:14,
from /usr/local/boost-1.59.0/include/boost/property_map/property_map.hpp:600,
from /usr/local/boost-1.59.0/include/boost/graph/properties.hpp:19,
from /usr/local/boost-1.59.0/include/boost/graph/compressed_sparse_row_graph.hpp:26,
from prog.cc:2:
/usr/local/boost-1.59.0/include/boost/smart_ptr/shared_ptr.hpp:249:65: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
template< class T, class R > struct sp_enable_if_auto_ptr< std::auto_ptr< T >, R >
^~~~~~~~
In file included from /usr/local/gcc-head/include/c++/7.0.0/memory:80:0,
from /usr/local/boost-1.59.0/include/boost/config/no_tr1/memory.hpp:21,
from /usr/local/boost-1.59.0/include/boost/smart_ptr/shared_ptr.hpp:23,
from /usr/local/boost-1.59.0/include/boost/shared_ptr.hpp:17,
from /usr/local/boost-1.59.0/include/boost/property_map/vector_property_map.hpp:14,
from /usr/local/boost-1.59.0/include/boost/property_map/property_map.hpp:600,
from /usr/local/boost-1.59.0/include/boost/graph/properties.hpp:19,
from /usr/local/boost-1.59.0/include/boost/graph/compressed_sparse_row_graph.hpp:26,
from prog.cc:2:
/usr/local/gcc-head/include/c++/7.0.0/bits/unique_ptr.h:51:28: note: declared here
template<typename> class auto_ptr;
^~~~~~~~
In file included from /usr/local/boost-1.59.0/include/boost/shared_ptr.hpp:17:0,
from /usr/local/boost-1.59.0/include/boost/property_map/vector_property_map.hpp:14,
from /usr/local/boost-1.59.0/include/boost/property_map/property_map.hpp:600,
from /usr/local/boost-1.59.0/include/boost/graph/properties.hpp:19,
from /usr/local/boost-1.59.0/include/boost/graph/compressed_sparse_row_graph.hpp:26,
from prog.cc:2:
/usr/local/boost-1.59.0/include/boost/smart_ptr/shared_ptr.hpp:448:31: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
explicit shared_ptr( std::auto_ptr<Y> & r ): px(r.get()), pn()
^~~~~~~~
In file included from /usr/local/gcc-head/include/c++/7.0.0/memory:80:0,
from /usr/local/boost-1.59.0/include/boost/config/no_tr1/memory.hpp:21,
from /usr/local/boost-1.59.0/include/boost/smart_ptr/shared_ptr.hpp:23,
from /usr/local/boost-1.59.0/include/boost/shared_ptr.hpp:17,
from /usr/local/boost-1.59.0/include/boost/property_map/vector_property_map.hpp:14,
from /usr/local/boost-1.59.0/include/boost/property_map/property_map.hpp:600,
from /usr/local/boost-1.59.0/include/boost/graph/properties.hpp:19,
from /usr/local/boost-1.59.0/include/boost/graph/compressed_sparse_row_graph.hpp:26,
from prog.cc:2:
/usr/local/gcc-head/include/c++/7.0.0/bits/unique_ptr.h:51:28: note: declared here
template<typename> class auto_ptr;
^~~~~~~~
In file included from /usr/local/boost-1.59.0/include/boost/shared_ptr.hpp:17:0,
from /usr/local/boost-1.59.0/include/boost/property_map/vector_property_map.hpp:14,
from /usr/local/boost-1.59.0/include/boost/property_map/property_map.hpp:600,
from /usr/local/boost-1.59.0/include/boost/graph/properties.hpp:19,
from /usr/local/boost-1.59.0/include/boost/graph/compressed_sparse_row_graph.hpp:26,
from prog.cc:2:
/usr/local/boost-1.59.0/include/boost/smart_ptr/shared_ptr.hpp:461:22: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
shared_ptr( std::auto_ptr<Y> && r ): px(r.get()), pn()
^~~~~~~~
In file included from /usr/local/gcc-head/include/c++/7.0.0/memory:80:0,
from /usr/local/boost-1.59.0/include/boost/config/no_tr1/memory.hpp:21,
from /usr/local/boost-1.59.0/include/boost/smart_ptr/shared_ptr.hpp:23,
from /usr/local/boost-1.59.0/include/boost/shared_ptr.hpp:17,
from /usr/local/boost-1.59.0/include/boost/property_map/vector_property_map.hpp:14,
from /usr/local/boost-1.59.0/include/boost/property_map/property_map.hpp:600,
from /usr/local/boost-1.59.0/include/boost/graph/properties.hpp:19,
from /usr/local/boost-1.59.0/include/boost/graph/compressed_sparse_row_graph.hpp:26,
from prog.cc:2:
/usr/local/gcc-head/include/c++/7.0.0/bits/unique_ptr.h:51:28: note: declared here
template<typename> class auto_ptr;
^~~~~~~~
In file included from /usr/local/boost-1.59.0/include/boost/shared_ptr.hpp:17:0,
from /usr/local/boost-1.59.0/include/boost/property_map/vector_property_map.hpp:14,
from /usr/local/boost-1.59.0/include/boost/property_map/property_map.hpp:600,
from /usr/local/boost-1.59.0/include/boost/graph/properties.hpp:19,
from /usr/local/boost-1.59.0/include/boost/graph/compressed_sparse_row_graph.hpp:26,
from prog.cc:2:
/usr/local/boost-1.59.0/include/boost/smart_ptr/shared_ptr.hpp:538:34: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
shared_ptr & operator=( std::auto_ptr<Y> & r )
^~~~~~~~
In file included from /usr/local/gcc-head/include/c++/7.0.0/memory:80:0,
from /usr/local/boost-1.59.0/include/boost/config/no_tr1/memory.hpp:21,
from /usr/local/boost-1.59.0/include/boost/smart_ptr/shared_ptr.hpp:23,
from /usr/local/boost-1.59.0/include/boost/shared_ptr.hpp:17,
from /usr/local/boost-1.59.0/include/boost/property_map/vector_property_map.hpp:14,
from /usr/local/boost-1.59.0/include/boost/property_map/property_map.hpp:600,
from /usr/local/boost-1.59.0/include/boost/graph/properties.hpp:19,
from /usr/local/boost-1.59.0/include/boost/graph/compressed_sparse_row_graph.hpp:26,
from prog.cc:2:
/usr/local/gcc-head/include/c++/7.0.0/bits/unique_ptr.h:51:28: note: declared here
template<typename> class auto_ptr;
^~~~~~~~
In file included from /usr/local/boost-1.59.0/include/boost/shared_ptr.hpp:17:0,
from /usr/local/boost-1.59.0/include/boost/property_map/vector_property_map.hpp:14,
from /usr/local/boost-1.59.0/include/boost/property_map/property_map.hpp:600,
from /usr/local/boost-1.59.0/include/boost/graph/properties.hpp:19,
from /usr/local/boost-1.59.0/include/boost/graph/compressed_sparse_row_graph.hpp:26,
from prog.cc:2:
/usr/local/boost-1.59.0/include/boost/smart_ptr/shared_ptr.hpp:547:34: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
shared_ptr & operator=( std::auto_ptr<Y> && r )
^~~~~~~~
In file included from /usr/local/gcc-head/include/c++/7.0.0/memory:80:0,
from /usr/local/boost-1.59.0/include/boost/config/no_tr1/memory.hpp:21,
from /usr/local/boost-1.59.0/include/boost/smart_ptr/shared_ptr.hpp:23,
from /usr/local/boost-1.59.0/include/boost/shared_ptr.hpp:17,
from /usr/local/boost-1.59.0/include/boost/property_map/vector_property_map.hpp:14,
from /usr/local/boost-1.59.0/include/boost/property_map/property_map.hpp:600,
from /usr/local/boost-1.59.0/include/boost/graph/properties.hpp:19,
from /usr/local/boost-1.59.0/include/boost/graph/compressed_sparse_row_graph.hpp:26,
from prog.cc:2:
/usr/local/gcc-head/include/c++/7.0.0/bits/unique_ptr.h:51:28: note: declared here
template<typename> class auto_ptr;
^~~~~~~~
In file included from /usr/local/boost-1.59.0/include/boost/shared_ptr.hpp:17:0,
from /usr/local/boost-1.59.0/include/boost/property_map/vector_property_map.hpp:14,
from /usr/local/boost-1.59.0/include/boost/property_map/property_map.hpp:600,
from /usr/local/boost-1.59.0/include/boost/graph/properties.hpp:19,
from /usr/local/boost-1.59.0/include/boost/graph/compressed_sparse_row_graph.hpp:26,
from prog.cc:2:
/usr/local/boost-1.59.0/include/boost/smart_ptr/shared_ptr.hpp: In member function 'boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(std::auto_ptr<_Up>&&)':
/usr/local/boost-1.59.0/include/boost/smart_ptr/shared_ptr.hpp:549:38: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
this_type( static_cast< std::auto_ptr<Y> && >( r ) ).swap( *this );
^~~~~~~~
In file included from /usr/local/gcc-head/include/c++/7.0.0/memory:80:0,
from /usr/local/boost-1.59.0/include/boost/config/no_tr1/memory.hpp:21,
from /usr/local/boost-1.59.0/include/boost/smart_ptr/shared_ptr.hpp:23,
from /usr/local/boost-1.59.0/include/boost/shared_ptr.hpp:17,
from /usr/local/boost-1.59.0/include/boost/property_map/vector_property_map.hpp:14,
from /usr/local/boost-1.59.0/include/boost/property_map/property_map.hpp:600,
from /usr/local/boost-1.59.0/include/boost/graph/properties.hpp:19,
from /usr/local/boost-1.59.0/include/boost/graph/compressed_sparse_row_graph.hpp:26,
from prog.cc:2:
/usr/local/gcc-head/include/c++/7.0.0/bits/unique_ptr.h:51:28: note: declared here
template<typename> class auto_ptr;
^~~~~~~~
Причина в том, что auto_ptr устарел.
Чтобы исправить это, используйте boost 1.60 или более позднюю версию или скомпилируйте с параметром -std=gnu++98.
person
Zehui Lin
schedule
13.12.2016
struct {} _ = expression;
, и в сообщении об ошибке компилятора будет точно указан тип `этого выражения. Однако обратите внимание, что только документация даст вам портативный способ сформулировать этот тип, как он у вас уже есть (WeightMap). - person sehe   schedule 13.12.2016