Function mask

Summary

#include <include/type_safe/flag_set.hpp>

(1) template <typename Enum, typename = detail::enable_flag<Enum>>
    constexpr flag_mask< Enum > mask(const Enum &flag) noexcept

(2) template <typename Enum>
    constexpr flag_mask< Enum > mask(const flag_combo< Enum > &combo) noexcept

(3) template <typename Enum>
    constexpr flag_mask< Enum > mask(const flag_set< Enum > &set) noexcept

Function overload

Synopsis

#include <include/type_safe/flag_set.hpp>

template <typename Enum, typename = detail::enable_flag<Enum>>
constexpr flag_mask< Enum > mask(const Enum &flag) noexcept

Description

Converts a flag combination to a flag mask.

Returns
The flag mask with the same value as the flag combination. \notes (1) does not participate in overload resolution, unless the argument is a flagg. \notes As you cannot use a combination to clear flags in a [ts::flag_set](), you cannot write a to clear all flags except a directly, you have to be explicit. \group mask_combo
Parameters

1 - \exclude

Source

Lines 384-388 in include/type_safe/flag_set.hpp.

template <typename Enum, typename = detail::enable_flag<Enum>>
constexpr flag_mask<Enum> mask(const Enum& flag) noexcept
{
    return flag_mask<Enum>(flag);
}

Synopsis

#include <include/type_safe/flag_set.hpp>

template <typename Enum>
constexpr flag_mask< Enum > mask(const flag_combo< Enum > &combo) noexcept

Description

\group mask_combo

Source

Lines 391-395 in include/type_safe/flag_set.hpp.

template <typename Enum>
constexpr flag_mask<Enum> mask(const flag_combo<Enum>& combo) noexcept
{
    return flag_mask<Enum>(combo);
}

Synopsis

#include <include/type_safe/flag_set.hpp>

template <typename Enum>
constexpr flag_mask< Enum > mask(const flag_set< Enum > &set) noexcept

Description

Converts a [ts::flag_set]() to a flag mask.

Returns
The flag mask with the same value as the set.

Source

Lines 623-627 in include/type_safe/flag_set.hpp.

template <typename Enum>
constexpr flag_mask<Enum> mask(const flag_set<Enum>& set) noexcept
{
    return flag_mask<Enum>(detail::get_flag_set_impl::get(set));
}





Add Discussion as Guest

Log in