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

📄 end.rst

📁 C++的一个好库。。。现在很流行
💻 RST
字号:
.. Sequences/Intrinsic Metafunctions//end

end
===

Synopsis
--------

.. parsed-literal::
    
    template<
          typename X
        >
    struct end
    {
        typedef |unspecified| type;
    };



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

Returns the sequence's past-the-end iterator. If the argument is not a 
|Forward Sequence|, returns |void_|.


Header
------

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


Model of
--------

|Tag Dispatched Metafunction|


Parameters
----------

+---------------+-------------------+-----------------------------------------------+
| Parameter     | Requirement       | Description                                   |
+===============+===================+===============================================+
| ``X``         | Any type          | A type whose end iterator, if any, will be    |
|               |                   | returned.                                     |
+---------------+-------------------+-----------------------------------------------+


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

For any arbitrary type ``x``:

.. parsed-literal::

    typedef end<x>::type last; 

:Return type:
    |Forward Iterator| or |void_|.

:Semantics:
    If ``x`` is |Forward Sequence|, ``last`` is an iterator pointing one past the 
    last element in ``s``; otherwise ``last`` is |void_|.

:Postcondition:
    If ``last`` is an iterator, it is past-the-end. 


Complexity
----------

Amortized constant time.


Example
-------

.. parsed-literal::
    
    typedef vector<long> v;
    typedef begin<v>::type first;
    typedef end<v>::type last;

    BOOST_MPL_ASSERT(( is_same< next<first>::type, last > ));


See also
--------

|Iterators|, |Forward Sequence|, |begin|, |end|, |next|

⌨️ 快捷键说明

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