解決初始化體重的問題後,如果使用boost 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 = GNU ++ 98編譯。
你想做什麼?將房產地圖與圖表關聯?這有幫助嗎? http://stackoverflow.com/questions/12501188/iterating-through-edge-weights-of-a-const-boostgraph – doctorlove
@doctorlove那不是它 – sehe
另一個竅門:使用'struct {} _ =表達式;'和編譯器錯誤消息將詳細說明該表達式的類型。但是請注意,只有文檔會給你提供這種類型的便攜方式(WeightMap) – sehe