As per the document, which says that [emphasise mine]:
Defined in header
template< class T >
struct atomic;
template< class U >
struct atomic<U*>;
(since C++11)
Defined in header
template< class U >
struct atomicstd::shared_ptr<U>;
template< class U >
struct atomicstd::weak_ptr<U>;
Defined in header <stdatomic.h> (since C++20)
Since the said partial specializations for std::shared<T>
is only available with C++20, could std::atomic<std::shared_ptr<Struct Demo>>
could be safely used with C++11?
Is there any potential problem that I should be aware of?
Aucun commentaire:
Enregistrer un commentaire