Is this C++ implementation for an Atomic float safe?

前端 未结 8 1606
有刺的猬
有刺的猬 2020-12-30 05:06

Edit: The code here still has some bugs in it, and it could do better in the performance department, but instead of trying to fix this, for t

8条回答
  •  情书的邮戳
    2020-12-30 05:55

    It looks like your implementation assumes that sizeof(size_t) == sizeof(float). Will that always be true for your target platforms?

    And I wouldn't say threading heresy so much as casting heresy. :)

提交回复
热议问题