Export (0) Print
Expand All

bit_not Function

Visual Studio 2013

A predefined function object that performs the bitwise complement (NOT) operation (unary operator~) on its argument.

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

// specialized transparent functor for operator~
template<> 
   struct bit_not<void> 
   {
      template<class Type>
      auto operator()(Type&& Right) const 
         -> decltype(~std::forward<Type>(Right));
   };

Type

A type that supports a unary operator~.

Right

The operand of the bitwise complement operation. The unspecialized template takes an lvalue reference argument of type Type. The specialized template does perfect forwarding of an lvalue or rvalue reference argument of inferred type Type.

The result of ~Right. The specialized template does perfect forwarding of the result, which has the type that's returned by operator~.

The bit_not functor is restricted to integral types for the basic data types, or to user-defined types that implement binary operator~.

Header: <functional>

Namespace: std

Show:
© 2014 Microsoft