Компиляция boost :: move в 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;
}

Я мог бы получить этот код для компиляции с использованием gcc 4.7.3 с флагом -std = c ++ 11 или -std = c ++ 0x. Однако в 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:

ошибка: нет совпадения для оператора! = в строке! = ((indexing :: skarf :: SkarfDatabase *) this) -> indexing :: skarf :: SkarfDatabase :: bucketFinderIndex.indexing :: skarf :: BucketIDT :: Finder

:: заканчивается P = features :: Descriptor, T = long unsigned 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: примечание: шаблон bool boost :: operator! = (const boost :: shared_array&, const boost :: shared_array&) /usr/local/include/boost/ptr_container/detail/void_ptr_iterator.hpp:185:21: примечание: шаблон 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: примечание: нет известного преобразования для аргумента 1 из «индексации :: skarf :: BucketIDT :: iterator» в «повышение контраста» :: пустой&/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: примечание: шаблон void boost :: operator! = (const boost :: function10&, const boost :: function10&) /usr/local/include/boost/function/function_template.hpp:1031:8: примечание: шаблон void boost :: operator! = (const boost :: function9&, const boost :: function9&) /usr/local/include/boost/function/function_template.hpp:1031:8: примечание: шаблон void boost :: operator! = (const boost :: function8&, const boost :: function8&) /usr/local/include/boost/function/function_template.hpp:1031:8: примечание: шаблон 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/include/boost/function/function_template.hpp:1031:8: примечание: шаблон 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: примечание: шаблон void boost :: operator! = (const boost :: function0&, const boost :: function0&) /usr/local/include/boost/function/function_template.hpp:1031:8: примечание: шаблон void 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: note: имя типа шаблона boost :: enable_if_c :: value> :: value, bool> :: type boost :: operator ! = (Функтор, 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&)

0

Решение

Boost был протестирован с gcc 4.3, поэтому 4.6 должен работать.

Вы смотрели на это:

http://www.boost.org/doc/libs/1_55_0/doc/html/move/implementing_movable_classes.html#move.implementing_movable_classes.copyable_and_movable_cpp0x

0

Другие решения

Других решений пока нет …