VCCC  2024.05
VisualCamp Common C++ library
decay_copy.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 2023/12/24.
3 //
4 
5 #ifndef VCCC_CORE_DECAY_COPY_HPP
6 #define VCCC_CORE_DECAY_COPY_HPP
7 
8 #include <type_traits>
9 
10 // Correcting decay_copy requirements of C++20 as if calling auto(x) in C++ 23
11 // See P0849R8 https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0849r8.html
12 #define vccc_decay_copy(x) std::decay_t<decltype(x)>(x)
13 
14 
15 #endif // VCCC_CORE_DECAY_COPY_HPP