⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 int_.rst

📁 C++的一个好库。。。现在很流行
💻 RST
字号:
.. Data Types/Numeric//int_ |20

int\_
=====

Synopsis
--------

.. parsed-literal::
    
    template<
          int N
        >
    struct int\_
    {
        // |unspecified|
        // ...
    };


Description
-----------

An |Integral Constant| wrapper for ``int``.


Header
------

.. parsed-literal::
    
    #include <boost/mpl/int.hpp>


Model of
--------

|Integral Constant|


Parameters
----------

+---------------+-------------------------------+---------------------------+
| Parameter     | Requirement                   | Description               |
+===============+===============================+===========================+
| ``N``         | An integral constant          | A value to wrap.          | 
+---------------+-------------------------------+---------------------------+

Expression semantics
--------------------

|Semantics disclaimer...| |Integral Constant|.

For arbitrary integral constant ``n``:

+-------------------+-----------------------------------------------------------+
| Expression        | Semantics                                                 |
+===================+===========================================================+
| ``int_<c>``       | An |Integral Constant| ``x`` such that ``x::value == c``  |
|                   | and ``x::value_type`` is identical to ``int``.            |
+-------------------+-----------------------------------------------------------+


Example
-------

.. parsed-literal::

    typedef int_<8> eight;
    
    BOOST_MPL_ASSERT(( is_same< eight::value_type, int > ));
    BOOST_MPL_ASSERT(( is_same< eight::type, eight > ));
    BOOST_MPL_ASSERT(( is_same< next< eight >::type, int_<9> > ));
    BOOST_MPL_ASSERT(( is_same< prior< eight >::type, int_<7> > ));
    BOOST_MPL_ASSERT_RELATION( (eight::value), ==, 8 );
    assert( eight() == 8 );


See also
--------

|Data Types|, |Integral Constant|, |long_|, |size_t|, |integral_c|

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -