diff options
| author | Shauren <shauren.trinity@gmail.com> | 2020-08-20 13:34:45 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2022-02-03 00:24:10 +0100 |
| commit | c37984fc6ad025519921487c0942e2766782dac5 (patch) | |
| tree | 273ac5150596dbfae187517b3c55483a410bbf61 /src/common/Utilities/advstd.h | |
| parent | 348acb105c316a2544e50ef3c6408f88207e85a7 (diff) | |
Core/Util: Added new utilities
* Trinity::new_from_tuple - same as std::make_from_tuple except allocates object using "new"
* Trinity::is_tuple - detects whether given type is a tuple specialization
* advstd::type_identity - C++20 std::type_identity
(cherry picked from commit 7c08fc863ac45f2d41b18103b0132004a4c0c524)
Diffstat (limited to 'src/common/Utilities/advstd.h')
| -rw-r--r-- | src/common/Utilities/advstd.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/Utilities/advstd.h b/src/common/Utilities/advstd.h index decead03156..c7727be472b 100644 --- a/src/common/Utilities/advstd.h +++ b/src/common/Utilities/advstd.h @@ -27,6 +27,17 @@ namespace advstd // C++20 std::remove_cvref_t template <class T> using remove_cvref_t = std::remove_cv_t<std::remove_reference_t<T>>; + + // C++20 std::type_identity + template <typename T> + struct type_identity + { + using type = T; + }; + + // C++20 std::type_identity_t + template <typename T> + using type_identity_t = typename type_identity<T>::type; } #endif |
