Function ref

Summary

#include <include/type_safe/reference.hpp>

(1) template <typename T>
    constexpr object_ref< T > ref(T &obj) noexcept

(2) template <typename T, std::size_t Size>
    array_ref< T > ref(T(&arr)[Size]) noexcept

(3) template <typename T>
    array_ref< T > ref(T *begin, T *end) noexcept

(4) template <typename T>
    array_ref< T > ref(T *array, size_t size) noexcept

Function overload

Synopsis

#include <include/type_safe/reference.hpp>

template <typename T>
constexpr object_ref< T > ref(T &obj) noexcept

Description

Creates a (const) [ts::object_ref]().

Returns
A [ts::object_ref]() to the given object. \group object_ref_ref

Mentioned in

Source

Lines 229-233 in include/type_safe/reference.hpp.

template <typename T>
constexpr object_ref<T> ref(T& obj) noexcept
{
    return object_ref<T>(obj);
}

Synopsis

#include <include/type_safe/reference.hpp>

template <typename T, std::size_t Size>
array_ref< T > ref(T(&arr)[Size]) noexcept

Description

Creates a [ts::array_ref]().

Returns
The reference created by forwarding the parameter(s) to the constructor. \group array_ref_ref

Mentioned in

Source

Lines 410-414 in include/type_safe/reference.hpp.

template <typename T, std::size_t Size>
array_ref<T> ref(T (&arr)[Size]) noexcept
{
    return array_ref<T>(arr);
}

Synopsis

#include <include/type_safe/reference.hpp>

template <typename T>
array_ref< T > ref(T *begin, T *end) noexcept

Description

\group array_ref_ref

Mentioned in

Source

Lines 417-421 in include/type_safe/reference.hpp.

template <typename T>
array_ref<T> ref(T* begin, T* end) noexcept
{
    return array_ref<T>(begin, end);
}

Synopsis

#include <include/type_safe/reference.hpp>

template <typename T>
array_ref< T > ref(T *array, size_t size) noexcept

Description

\group array_ref_ref

Mentioned in

Source

Lines 424-428 in include/type_safe/reference.hpp.

template <typename T>
array_ref<T> ref(T* array, size_t size) noexcept
{
    return array_ref<T>(array, size);
}





Add Discussion as Guest

Log in