not_.rst
来自「C++的一个好库。。。现在很流行」· RST 代码 · 共 96 行
RST
96 行
.. Metafunctions/Logical Operations//not_ |30
not\_
=====
Synopsis
--------
.. parsed-literal::
template<
typename F
>
struct not\_
{
typedef |unspecified| type;
};
Description
-----------
Returns the result of *logical not* (``!``) operation on its argument.
Header
------
.. parsed-literal::
#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``:
.. parsed-literal::
typedef not_<f>::type r;
:Return type:
|Integral Constant|.
:Semantics:
Equivalent to
.. parsed-literal::
typedef bool_< (!f::type::value) > r;
.. ..........................................................................
.. parsed-literal::
typedef not_<f> r;
:Return type:
|Integral Constant|.
:Semantics:
Equivalent to
.. parsed-literal::
struct r : not_<f>::type {};
Example
-------
.. parsed-literal::
BOOST_MPL_ASSERT_NOT(( not_< true\_ > ));
BOOST_MPL_ASSERT(( not_< false\_ > ));
See also
--------
|Metafunctions|, |Logical Operations|, |and_|, |or_|
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?