Mundy: Multibody Nonlocal Dynamics Version of the Day
Loading...
Searching...
No Matches
mundy::reference_wrapper< T > Class Template Reference

A Kokkos-compatible wrapper around a reference. More...

#include <reference_wrapper.hpp>

Public Types

using type = T

Public Member Functions

constexpr reference_wrapper (T &ref) noexcept
 reference_wrapper (T &&)=delete
constexpr reference_wrapper (const reference_wrapper &)=default
constexpr reference_wrapperoperator= (const reference_wrapper &)=default
constexpr operator T& () const noexcept
constexpr T & get () const noexcept
template<class... Args>
constexpr decltype(auto) operator() (Args &&... args) const
template<class Index>
constexpr decltype(auto) operator[] (Index &&idx) const
template<class... Args>
constexpr decltype(auto) operator() (Args &&... args)
template<class Index>
constexpr decltype(auto) operator[] (Index &&idx)

Detailed Description

template<class T>
class mundy::reference_wrapper< T >

Provides the same core behavior as std::reference_wrapper:

  • stores a reference as a pointer,
  • implicit conversion back to T&,
  • get(),
  • callable forwarding with operator() when T is invocable.

Member Typedef Documentation

◆ type

template<class T>
using mundy::reference_wrapper< T >::type = T

Constructor & Destructor Documentation

◆ reference_wrapper() [1/3]

template<class T>
mundy::reference_wrapper< T >::reference_wrapper ( T & ref)
inlineconstexprnoexcept

◆ reference_wrapper() [2/3]

template<class T>
mundy::reference_wrapper< T >::reference_wrapper ( T && )
delete

◆ reference_wrapper() [3/3]

template<class T>
mundy::reference_wrapper< T >::reference_wrapper ( const reference_wrapper< T > & )
constexprdefault

Member Function Documentation

◆ operator=()

template<class T>
reference_wrapper & mundy::reference_wrapper< T >::operator= ( const reference_wrapper< T > & )
constexprdefault

◆ operator T&()

template<class T>
mundy::reference_wrapper< T >::operator T& ( ) const
inlineconstexprnoexcept

◆ get()

template<class T>
T & mundy::reference_wrapper< T >::get ( ) const
inlineconstexprnoexcept

◆ operator()() [1/2]

template<class T>
template<class... Args>
decltype(auto) mundy::reference_wrapper< T >::operator() ( Args &&... args) const
inlineconstexpr

◆ operator[]() [1/2]

template<class T>
template<class Index>
decltype(auto) mundy::reference_wrapper< T >::operator[] ( Index && idx) const
inlineconstexpr

◆ operator()() [2/2]

template<class T>
template<class... Args>
decltype(auto) mundy::reference_wrapper< T >::operator() ( Args &&... args)
inlineconstexpr

◆ operator[]() [2/2]

template<class T>
template<class Index>
decltype(auto) mundy::reference_wrapper< T >::operator[] ( Index && idx)
inlineconstexpr