C++的一个好库。。。现在很流行

源代码在线查看: copy.rst

软件大小: 21075 K
上传用户: lyyfengyutongzh
关键词:
下载地址: 免注册下载 普通下载 VIP

相关代码

				.. Algorithms/Transformation Algorithms//copy |10
				
				copy
				====
				
				Synopsis
				--------
				
				.. parsed-literal::
				    
				    template<
				          typename Sequence
				        , typename In = |unspecified|
				        >
				    struct copy
				    {
				        typedef |unspecified| type;
				    };
				
				
				
				Description
				-----------
				
				Returns a copy of the original sequence. 
				
				|transformation algorithm disclaimer|
				
				
				Header
				------
				
				.. parsed-literal::
				    
				    #include 
				
				
				Model of
				--------
				
				|Reversible Algorithm|
				
				
				Parameters
				----------
				
				+---------------+---------------------------+-------------------------------+
				| Parameter     | Requirement               | Description                   |
				+===============+===========================+===============================+
				| ``Sequence``  | |Forward Sequence|        | A sequence to copy.           |
				+---------------+---------------------------+-------------------------------+
				| ``In``        | |Inserter|                | An inserter.                  |
				+---------------+---------------------------+-------------------------------+
				
				
				Expression semantics
				--------------------
				
				|Semantics disclaimer...| |Reversible Algorithm|.
				
				For any |Forward Sequence| ``s``, and an |Inserter| ``in``:
				
				.. parsed-literal::
				
				    typedef copy::type r; 
				
				:Return type:
				    A type.
				
				:Semantics:
				    Equivalent to 
				
				    .. parsed-literal::
				        
				        typedef fold< s,in::state,in::operation >::type r;
				
				
				
				Complexity
				----------
				
				Linear. Exactly ``size::value`` applications of ``in::operation``. 
				
				
				Example
				-------
				
				.. parsed-literal::
				    
				    typedef vector_c numbers;
				    typedef copy<
				          range_c
				        , back_inserter< numbers >
				        >::type result;
				    
				    BOOST_MPL_ASSERT_RELATION( size::value, ==, 20 );
				    BOOST_MPL_ASSERT(( equal< result,range_c > ));
				
				
				See also
				--------
				
				|Transformation Algorithms|, |Reversible Algorithm|, |reverse_copy|, |copy_if|, |transform|
							

相关资源