bit_or 函数

预定义在参数上执行按位或运算(二元operator|)的函数对象。

template<class Type = void>
   struct bit_or : public binary_function< Type, Type, Type > {
      Type operator()(
         const Type& Left, 
         const Type& Right
      ) const;
   };

// specialized transparent functor for operator|
template<>
   struct bit_or<void>
   {
      template<class Type1, class Type2>
      auto operator()(Type1&& Left, Type2&& Right) const
         -> decltype(std::forward<Type1>(Left)
            | std::forward<Type2>(Right));
   };

参数

  • Type, Type1, Type2
    任何支持operator| 使用指定或者推导类型的操作数的类型。

  • Left
    按位或运算的左侧操作数。 未指定的模版需要类型Type的左值引用参数。 专有模版确实完美地继承了推断类型Type1的左值和右值引用参数。

  • Right
    按位或运算的右侧操作数。 未指定的模版需要类型Type的左值引用参数。 专有模版确实完美地继承了推断类型Type2的左值和右值引用参数。

返回值

Left 的结果。 | Right. 拥有通过operator|返回的类型的专有模版确实完美地遵循了结果。

备注

bit_or 函数限制为基本数据类型的整数类型,或者实现operator|的用户定义类型。

要求

标头: <起作用的>

命名空间: std

请参见

参考

<functional>

Lvalues 和 Rvalues

标准模板库

其他资源

functional 成员

functional 成员