Add "struct std::atomic" as a safe class name

You should make all this file static and const, to avoid allocating them every time you call the function. That will probably speed up a lot this function.