簡體   English   中英

編譯boost :: move在gcc 4.6.4中

[英]Compiling boost::move in gcc 4.6.4

我有一個使用Boost :: move移動鎖的功能-

/**
 * Moving assignment operator transfers ownership of the lock
 */
 const_iterator& operator=(const_iterator && other) {
    if (this != &other) {
        iter = other.iter;
        lock = boost::move(other.lock);
    }
    return *this;
 }

我可以使用帶有-std = c ++ 11或-std = c ++ 0x標志的gcc 4.7.3來編譯此代碼。 但是,對於gcc 4.6.4,即使使用-std = c ++ 0x標志,該代碼也會失敗。 有想法該怎么解決這個嗎?

CMAKE標志用於使用C ++ 11功能:

set(CMAKE_CXX_FLAGS "-std=c++11")

CMAKE標志用於使用C ++ 0x功能:

set(CMAKE_CXX_FLAGS "-std=c++0x")

我在gcc 4.6.4中遇到的錯誤:

錯誤:在“ iter!=”中沒有匹配“ operator!=”的字符((indexing :: skarf :: SkarfDatabase *)this)-> indexing :: skarf :: SkarfDatabase :: bucketFinderIndex.indexing :: skarf :: BucketIDT ::搜索

:::以P =功能::描述符結尾,T =未簽名的長整數int’/home/rahulg/ripe/src/index/skarf/SkarfDatabase.hpp:141:40:注意:候選對象是:/ usr / local / include /boost/smart_ptr/shared_array.hpp:264:31:注意:模板bool boost :: operator!=(boost :: detail :: sp_nullptr_t,const boost :: shared_array&)/ usr / local / include / boost / smart_ptr / shared_array .hpp:259:31:注意:模板bool boost :: operator!=(const boost :: shared_array&,boost :: detail :: sp_nullptr_t)/usr/local/include/boost/smart_ptr/shared_array.hpp:242:31 :注意:template bool boost :: operator!=(const boost :: shared_array&,const boost :: shared_array&)/usr/local/include/boost/ptr_container/detail/void_ptr_iterator.hpp:185:21:注意:template bool boost :: operator!=(const boost :: void_ptr_iterator&,const boost :: void_ptr_iterator&)/usr/local/include/boost/blank.hpp:73:13:注意:bool boost :: operator!=(const boost :: blank& ,const boost :: blank&)/usr/local/include/boost/blank.hpp:73:13:注意:參數â€的未知轉換 indexing :: skarf :: BucketIDT :: iterator™到const boost :: blank&/usr/local/include/boost/range/sub_range.hpp:161:17:注意:模板bool boost :: operator !=(const boost :: sub_range&,const boost :: sub_range&)/usr/local/include/boost/function/function_template.hpp:1031:8:注意:模板無效boost :: operator!=(const boost :: function10& ,const boost :: function10&)/usr/local/include/boost/function/function_template.hpp:1031:8:注意:template void boost :: operator!=(const boost :: function9&,const boost :: function9&)/ usr / local / include / boost / function / function_template.hpp:1031:8:注意:template void boost :: operator!=(const boost :: function8&,const boost :: function8&)/ usr / local / include / boost / function / function_template.hpp:1031:8:注意:template void boost :: operator!=(const boost :: function7&,const boost :: function7&)/usr/local/include/boost/function/function_template.hpp:1031: 8:注意:模板void boost :: operator!=(const boost :: function6&,const boost :: function6&)/ usr / local / in clude / boost / function / function_template.hpp:1031:8:注意:template void boost :: operator!=(const boost :: function5&,const boost :: function5&)/ usr / local / include / boost / function / function_template。 hpp:1031:8:注意:模板void boost :: operator!=(const boost :: function4&,const boost :: function4&)/usr/local/include/boost/function/function_template.hpp:1031:8:注意:模板void boost :: operator!=(const boost :: function3&,const boost :: function3&)/usr/local/include/boost/function/function_template.hpp:1031:8:注意:模板void boost :: operator!= (const boost :: function2&,const boost :: function2&)/usr/local/include/boost/function/function_template.hpp:1031:8:注意:模板無效boost :: operator!=(const boost :: function0&,const boost :: function0&)/usr/local/include/boost/function/function_template.hpp:1031:8:注意:模板無效boost :: operator!=(const boost :: function1&,const boost :: function1&)/ usr / local / include / boost / function / function_base.hpp:872:3:注意:模板類型名稱boost :: enable_if_c :: value> :: value,bool> :: type boost :: operator!=(boost :: reference_wrapper,const boost :: function_base&)/usr/local/include/boost/function/function_base.hpp:863:3:注意:模板類型名稱boost :: enable_if_c :: value> :: value,bool> :: type boost :: operator!=(const boost :: function_base&,boost :: reference_wrapper)/ usr / local / include / boost / function / function_base.hpp:835:3:注意:模板類型名稱boost :: enable_if_c :: value> :: value,bool> :: type boost :: operator!=(Functor,const boost :: function_base&)/ usr / local / include /boost/function/function_base.hpp:826:3:注意:模板類型名稱boost :: enable_if_c :: value> :: value,bool> :: type boost :: operator!=(const boost :: function_base&,Functor)/ usr / local / include / boost / function / function_base.hpp:764:13:注意:bool boost :: operator!=(boost :: detail :: function :: useless_clear_type *,const boost :: function_base&)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM