utility 599 B

12345678910111213141516171819202122232425262728293031323334
  1. // -*-c++-*-
  2. // vim: set ft=cpp:
  3. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  4. file Copyright.txt or https://cmake.org/licensing for details. */
  5. #ifndef cm_utility
  6. #define cm_utility
  7. #if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
  8. # define CMake_HAVE_CXX_IN_PLACE
  9. #endif
  10. #include <utility> // IWYU pragma: export
  11. namespace cm {
  12. #if defined(CMake_HAVE_CXX_IN_PLACE)
  13. using std::in_place_t;
  14. using std::in_place;
  15. #else
  16. struct in_place_t
  17. {
  18. explicit in_place_t() = default;
  19. };
  20. constexpr in_place_t in_place{};
  21. #endif
  22. }
  23. #endif