std :: atomic_is_lock_free(shared_ptr <T>*)没有编译

大宝剑*_*大宝剑 6 c++ c++11

我的简单代码如下:

#include <iostream>
#include <atomic>
#include <memory>

int main(void) {
    std::shared_ptr<int> p = std::make_shared<int>(5);
    std::cout << std::boolalpha << std::atomic_is_lock_free(&p) << std::endl;
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

但编译错误:

a.cpp:在函数'int main()'中:a.cpp:7:60:错误:没有匹配函数用于调用'atomic_is_lock_free(std :: shared_ptr*)'std :: cout << std :: boolalpha < <std :: atomic_is_lock_free(&p)<< std :: endl; ^ a.cpp:7:60:注意:候选人是:在a.cpp中包含的文件中:2:0:/usr/include/c++/4.8.2/atomic:804:5:注意:模板bool std :: atomic_is_lock_free(const std :: atomic <_ITp>*)atomic_is_lock_free(const atomic <_ITp>*__a)noexcept ^ /usr/include/c++/4.8.2/atomic:804:5:注意:模板参数推断/替换失败: a.cpp:7:60:注意:'std :: shared_ptr'不是来自'const std :: atomic <_ITp>'std :: cout << std :: boolalpha << std :: atomic_is_lock_free(&p)< <std :: endl; ^在a.cpp中包含的文件中:2:0:/usr/include/c++/4.8.2/atomic:809:5:注意:模板bool std :: atomic_is_lock_free(const volatile std :: atomic <_ITp>*) atomic_is_lock_free(const volatile atomic <_ITp>*__a)noexcept ^ /usr/include/c++/4.8.2/atomic:809:5:注意:模板参数演绎/替换失败:a.cpp:7:60:注意:' std :: shared_ptr'不是来自'const volatile std :: atomic <_ITp>'std :: cout << std :: boolalpha << std :: atomic_is_lock_free(&p)<< std :: endl;

没有template <class T> bool atomic_is_lock_free( const std::shared_ptr<T>* p );过载.就像这里说的那样.我的代码一定有错误,有人可以帮帮我吗?谢谢!