Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
Front Page / Metafunctions / Logical Operations / not_

not_

Synopsis

template<
      typename F
    >
struct not_
{
    typedef unspecified type;
};

Description

Returns the result of logical not (!) operation on its argument.

Header

#include <boost/mpl/not.hpp>
#include <boost/mpl/logical.hpp>

Parameters

Parameter Requirement Description
F Nullary Metafunction Operation's argument.

Expression semantics

For arbitrary nullary Metafunction f:

typedef not_<f>::type r;
Return type:

Integral Constant.

Semantics:

Equivalent to

typedef bool_< (!f::type::value) > r;
typedef not_<f> r;
Return type:

Integral Constant.

Semantics:

Equivalent to

struct r : not_<f>::type {};

Example

BOOST_MPL_ASSERT_NOT(( not_< true_ > ));
BOOST_MPL_ASSERT(( not_< false_ > ));

See also

Metafunctions, Logical Operations, and_, or_