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
9
namespace
wmtk::utils::metaprogramming
{
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>
15
struct
unwrap_reference
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>
31
using
unwrap_ref_decay_t
=
typename
unwrap_ref_decay<T>::type
;
32
}
// namespace wmtk::utils::metaprogramming
std
Definition:
autodiff.h:995
wmtk::utils::metaprogramming
Definition:
as_mesh_variant.cpp:9
wmtk::utils::metaprogramming::unwrap_ref_decay_t
typename unwrap_ref_decay< T >::type unwrap_ref_decay_t
Definition:
unwrap_ref.hpp:31
wmtk::utils::metaprogramming::unwrap_ref_decay
Definition:
unwrap_ref.hpp:27
wmtk::utils::metaprogramming::unwrap_reference< std::reference_wrapper< U > >::type
U & type
Definition:
unwrap_ref.hpp:22
wmtk::utils::metaprogramming::unwrap_reference
Definition:
unwrap_ref.hpp:16
wmtk::utils::metaprogramming::unwrap_reference::type
T type
Definition:
unwrap_ref.hpp:17
src
wmtk
utils
metaprogramming
unwrap_ref.hpp
Generated by
1.9.1