Wildmeshing Toolkit
unwrap_ref.hpp
Go to the documentation of this file.
1 
2 #pragma once
3 #include <functional>
4 #include <type_traits>
5 #include <utility>
6 #include <variant>
7 
8 
10 // Re-implement unwrap ref in case it doesn't exist with our current compiler
11 // Implementation is the Possible Implementation from:
12 // https://en.cppreference.com/w/cpp/utility/functional/unwrap_reference
13 
14 template <class T>
16 {
17  using type = T;
18 };
19 template <class U>
20 struct unwrap_reference<std::reference_wrapper<U>>
21 {
22  using type = U&;
23 };
24 
25 template <class T>
26 struct unwrap_ref_decay : unwrap_reference<std::decay_t<T>>
27 {
28 };
29 
30 template <class T>
32 } // namespace wmtk::utils::metaprogramming
Definition: autodiff.h:995
typename unwrap_ref_decay< T >::type unwrap_ref_decay_t
Definition: unwrap_ref.hpp:31