Quantcast
Channel: C++ why the type of parameter of atomic_load is pointer instead of reference? - Stack Overflow
Viewing all articles
Browse latest Browse all 2

C++ why the type of parameter of atomic_load is pointer instead of reference?

$
0
0

I agree the answer in When to use references vs. pointers.
But, I am wondering why C++ defines atomic_load as

template<class T>T atomic_load(const std::atomic<T> *obj) noexcept;                                   ^

instead of

template<class T>T atomic_load(const std::atomic<T> &obj) noexcept;                                   ^

Can anyone help me?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images