不能在英特尔编译器中使用'tbb / atomic.h'

时间:2014-03-19 23:57:18

标签: c++ c atomic intel tbb

我无法访问TBB原子类型的任何功能(fetch / load / etc.)。当我看到&t; tbb / atomic.h'每个宏的实例都有错误:' __ TBB_DECL_ATOMIC(...)'

错误: '纯说明符(= 0)仅允许用于虚拟功能'

相反,可以使用MSVC编译器访问所有内容并进行编译。

这是使用最新版本的英特尔C ++编译器,最新版本的TBB,64位操作系统,64位版本。即使查看宏观代码,我也无法分辨出它的来源。我错过了编译器标志还是什么?

#define __TBB_DECL_ATOMIC(T)                                                                    \
    template<> struct atomic<T>: internal::atomic_impl_with_arithmetic<T,T,char> {              \
        atomic() = default;                                                                             \
        constexpr atomic(T arg): internal::atomic_impl_with_arithmetic<T,T,char>(arg) {}        \
                                                                                                \
        T operator=( T rhs ) {return store_with_release(rhs);}                                  \
        atomic<T>& operator=( const atomic<T>& rhs ) {store_with_release(rhs); return *this;}   \
    };

1 个答案:

答案 0 :(得分:1)

发现了这个问题。编译器编译得很好,但环境(VS2012)没有识别C ++ 11所以我没有得到Intellisense而且我得到错误的错误曲线。