mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-02 20:00:38 -06:00
Provide a standardized way to handle the C++ "standard" headers
customized to be used with current CMake C++ standard constraints.
Offer under directory `cm` headers which can be used as direct
replacements of the standard ones. For example:
#include <cm/string_view>
can be used safely for CMake development in place of the `<string_view>`
standard header.
Fixes: #19491
35 lines
599 B
C++
35 lines
599 B
C++
// -*-c++-*-
|
|
// vim: set ft=cpp:
|
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
|
#ifndef cm_utility
|
|
#define cm_utility
|
|
|
|
#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
|
|
# define CMake_HAVE_CXX_IN_PLACE
|
|
#endif
|
|
|
|
#include <utility> // IWYU pragma: export
|
|
|
|
namespace cm {
|
|
|
|
#if defined(CMake_HAVE_CXX_IN_PLACE)
|
|
|
|
using std::in_place_t;
|
|
using std::in_place;
|
|
|
|
#else
|
|
|
|
struct in_place_t
|
|
{
|
|
explicit in_place_t() = default;
|
|
};
|
|
|
|
constexpr in_place_t in_place{};
|
|
|
|
#endif
|
|
}
|
|
|
|
#endif
|