lundi 23 juillet 2018

Wrapping a memory address as std::atomic

I have:

int* p = 0xf

How can I wrap p as std::atomic<int>? I would like someting like:

std::atomic<int> wp = wrap(p);
wp.store(100); 

And wp.store(100) stored 100 to 0xf

Aucun commentaire:

Enregistrer un commentaire