exactinit.cpp 762 B

123456789101112131415161718192021222324
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2019 Qingnan Zhou <[email protected]>
  4. // Copyright (C) 2025 Alec Jacobson <[email protected]>
  5. //
  6. // This Source Code Form is subject to the terms of the Mozilla Public License
  7. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  8. // obtain one at http://mozilla.org/MPL/2.0/.
  9. #include "exactinit.h"
  10. #include <predicates.h>
  11. IGL_INLINE void igl::predicates::exactinit() {
  12. // Thread-safe initialization using Meyers' singleton
  13. class MySingleton {
  14. public:
  15. static MySingleton& instance() {
  16. static MySingleton instance;
  17. return instance;
  18. }
  19. private:
  20. MySingleton() { ::exactinit(); }
  21. };
  22. MySingleton::instance();
  23. }