SpECTRE  v2024.03.19
tt::remove_reference_wrapper< T > Struct Template Reference

Gets the underlying type if the type is a std::reference_wrapper, otherwise returns the type itself. More...

#include <RemoveReferenceWrapper.hpp>

Public Types

using type = T
 

Detailed Description

template<typename T>
struct tt::remove_reference_wrapper< T >

Gets the underlying type if the type is a std::reference_wrapper, otherwise returns the type itself.

Usage

For any type I,

Gets the underlying type if the type is a std::reference_wrapper, otherwise returns the type itself.
Definition: RemoveReferenceWrapper.hpp:30

Returns: either I::type if I is a std::reference_wrapper, else returns I

Example

static_assert(
std::is_same_v<const double, tt::remove_reference_wrapper_t<
"Failed testing remove_reference_wrapper");
static_assert(
std::is_same_v<const double, tt::remove_reference_wrapper_t<const double>>,
"Failed testing remove_reference_wrapper");
static_assert(
std::is_same_v<
double, tt::remove_reference_wrapper_t<std::reference_wrapper<double>>>,
"Failed testing remove_reference_wrapper");
static_assert(std::is_same_v<double, tt::remove_reference_wrapper_t<double>>,
"Failed testing remove_reference_wrapper");
static_assert(std::is_same_v<const A, tt::remove_reference_wrapper_t<
"Failed testing remove_reference_wrapper");
static_assert(std::is_same_v<const A, tt::remove_reference_wrapper_t<const A>>,
"Failed testing remove_reference_wrapper");
static_assert(std::is_same_v<
A, tt::remove_reference_wrapper_t<std::reference_wrapper<A>>>,
"Failed testing remove_reference_wrapper");
static_assert(std::is_same_v<A, tt::remove_reference_wrapper_t<A>>,
"Failed testing remove_reference_wrapper");
static_assert(std::is_same_v<double, tt::remove_reference_wrapper_t<
"Failed testing remove_reference_wrapper");
static_assert(
std::is_same_v<double, tt::remove_reference_wrapper_t<
"Failed testing remove_reference_wrapper");
static_assert(
std::is_same_v<double, tt::remove_reference_wrapper_t<
"Failed testing remove_reference_wrapper");
static_assert(std::is_same_v<const double,
tt::remove_reference_wrapper_t<
"Failed testing remove_reference_wrapper");
static_assert(
std::is_same_v<const double,
tt::remove_reference_wrapper_t<
"Failed testing remove_reference_wrapper");
static_assert(
std::is_same_v<const double,
tt::remove_reference_wrapper_t<
"Failed testing remove_reference_wrapper");
static_assert(
std::is_same_v<
A, tt::remove_reference_wrapper_t<const std::reference_wrapper<A>>>,
"Failed testing remove_reference_wrapper");
static_assert(
std::is_same_v<
A, tt::remove_reference_wrapper_t<volatile std::reference_wrapper<A>>>,
"Failed testing remove_reference_wrapper");
static_assert(std::is_same_v<A, tt::remove_reference_wrapper_t<
const volatile std::reference_wrapper<A>>>,
"Failed testing remove_reference_wrapper");
static_assert(
std::is_same_v<const A, tt::remove_reference_wrapper_t<
"Failed testing remove_reference_wrapper");
static_assert(
std::is_same_v<const A, tt::remove_reference_wrapper_t<
"Failed testing remove_reference_wrapper");
static_assert(std::is_same_v<
const A, tt::remove_reference_wrapper_t<
"Failed testing remove_reference_wrapper");
See also
std::reference_wrapper

The documentation for this struct was generated from the following file: