После исправления проблемы инициализации вес предупреждения будут отображаться, если компиляция с повышением 1.58 и -std = gnu ++ 11: wandbox
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
Чтобы исправить это, используйте подталкивание 1,60 или более поздней версии, или скомпилировать с -std = гну ++ 98.
Что вы пытаетесь сделать? Связать карту свойств с графом? Помогает ли это? http://stackoverflow.com/questions/12501188/iterating-through-edge-weights-of-a-const-boostgraph – doctorlove
@doctorlove, это не он – sehe
Другой трюк: используйте 'struct {} _ = expression;' и компилятор сообщение об ошибке будет точно детализировать тип этого выражения. Обратите внимание, однако, что только документация предоставит вам переносимый способ формулировать этот тип, как у вас уже было (WeightMap) – sehe