header_utils
Loading...
Searching...
No Matches
cpp17.h
1#pragma once
2#include "../min-cpp-version/cpp14.h"
3#include <type_traits>
4
5#if __cplusplus < 201703L && (!defined(_MSVC_LANG) || _MSVC_LANG < 201703L)
6#error "This file requires compiler and library support for the ISO C++ 2017 standard."
7#endif
8
9#if !defined(__cpp_concepts)
10#define GHPL_REQUIRES(...)
11#define GHPL_TYPENAME(...) typename
12#define GHPL_CONCEPT(name) constexpr inline bool name
13#else
14#define GHPL_REQUIRES(...) requires __VA_ARGS__
15#define GHPL_TYPENAME(...) __VA_ARGS__
16#define GHPL_CONCEPT(name) concept name
17#endif
18
19namespace ghassanpl
20{
21#if defined(__cpp_lib_remove_cvref) && __cpp_lib_remove_cvref >= 201711L
22 using std::remove_cvref;
23 using std::remove_cvref_t;
24#else
25 template <class T>
26 using remove_cvref_t = std::remove_cv_t<std::remove_reference_t<T>>;
27
28 template <class T>
29 struct remove_cvref { using type = remove_cvref_t<T>; };
30#endif
31
32 template <typename FROM, typename TO>
33 using copy_const = std::conditional_t<std::is_const_v<FROM>, std::add_const_t<TO>, TO>;
34}
Primary namespace for everything in this library.
Definition align+rec2.h:10