Function tag

Synopsis

#include <include/type_safe/constrained_type.hpp>

template <typename T, typename Constraint>
constexpr auto tag(T &&value, Constraint c) -> tagged_type< typename std::decay< T >::type, Constraint >

Description

Creates a new [ts::tagged_type]().

Returns
A [ts::tagged_type]() with the given value and Constraint.

Source

Lines 527-532 in include/type_safe/constrained_type.hpp.

template <typename T, typename Constraint>
constexpr auto tag(T&& value, Constraint c) -> tagged_type<typename std::decay<T>::type, Constraint>
{
    return tagged_type<typename std::decay<T>::type, Constraint>(std::forward<T>(value),
                                                                 std::move(c));
}





Add Discussion as Guest

Log in