Function operator&

Summary

#include <include/type_safe/flag_set.hpp>

(1) template <typename Enum>
    constexpr flag_set< Enum > operator&(const flag_set< Enum > &a, const flag_mask< Enum > &b)

(2) template <typename Enum>
    constexpr flag_set< Enum > operator&(const flag_mask< Enum > &a, const flag_set< Enum > &b)

(3) template <typename Enum, typename FlagCombo, typename = detail::enable_flag_combo<FlagCombo, Enum>>
    constexpr bool operator&(const flag_set< Enum > &a, const FlagCombo &b)

(4) template <typename Enum, typename FlagCombo, typename = detail::enable_flag_combo<FlagCombo, Enum>>
    constexpr bool operator&(const FlagCombo &a, const flag_set< Enum > &b)

Function overload

Synopsis

#include <include/type_safe/flag_set.hpp>

template <typename Enum>
constexpr flag_set< Enum > operator&(const flag_set< Enum > &a, const flag_mask< Enum > &b)

Description

\group bitwise_op

Source

Lines 735-739 in include/type_safe/flag_set.hpp.

template <typename Enum>
constexpr flag_set<Enum> operator&(const flag_set<Enum>& a, const flag_mask<Enum>& b)
{
    return combo(mask(a).bitwise_and(b));
}

Synopsis

#include <include/type_safe/flag_set.hpp>

template <typename Enum>
constexpr flag_set< Enum > operator&(const flag_mask< Enum > &a, const flag_set< Enum > &b)

Description

\group bitwise_op

Source

Lines 741-745 in include/type_safe/flag_set.hpp.

template <typename Enum>
constexpr flag_set<Enum> operator&(const flag_mask<Enum>& a, const flag_set<Enum>& b)
{
    return b & a;
}

Synopsis

#include <include/type_safe/flag_set.hpp>

template <typename Enum, typename FlagCombo, typename = detail::enable_flag_combo<FlagCombo, Enum>>
constexpr bool operator&(const flag_set< Enum > &a, const FlagCombo &b)

Description

Checks whether a combination of flags is set in a.

Returns
true if all the flags set in b are also set in a, false otherwise. \notes These functions do not participate in overload resolution, unless FlagCombo is a flag operation. \group bitwise_and_check Bitwise and for flag_set
Parameters

2 - \exclude

Source

Lines 755-759 in include/type_safe/flag_set.hpp.

template <typename Enum, typename FlagCombo, typename = detail::enable_flag_combo<FlagCombo, Enum>>
constexpr bool operator&(const flag_set<Enum>& a, const FlagCombo& b)
{
    return static_cast<bool>(combo(a).bitwise_and(flag_combo<Enum>(b)).to_int());
}

Synopsis

#include <include/type_safe/flag_set.hpp>

template <typename Enum, typename FlagCombo, typename = detail::enable_flag_combo<FlagCombo, Enum>>
constexpr bool operator&(const FlagCombo &a, const flag_set< Enum > &b)

Description

\group bitwise_and_check

Parameters

2 - \exclude

Source

Lines 763-767 in include/type_safe/flag_set.hpp.

template <typename Enum, typename FlagCombo, typename = detail::enable_flag_combo<FlagCombo, Enum>>
constexpr bool operator&(const FlagCombo& a, const flag_set<Enum>& b)
{
    return b & a;
}





Add Discussion as Guest

Log in