程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> C語言 >> C++ >> C++入門知識 >> 實現的一些內存輔助操作函數

實現的一些內存輔助操作函數

編輯:C++入門知識

其中有一個函數調用了std::copy,本來想自己實現這個copy函數的,不過為了能先用上這些內存輔助函數來實現我的容器類和算法,只好過一段時間來實現一個自己的高效的實現copy函數

   _STL_UNINITIALIZED_H_
 
 #include 
 #include 
 #include 
 
 
 
       
     template< InputIterator,  ForwardIterator,  T>
          ForwardIterator result, T*     template< InputIterator,  ForwardIterator>
       template< InputIterator,  ForwardIterator>
   
     template< InputIterator,  ForwardIterator>
                  template<>
     inline  *uninitialized_copy(  *first,   *last,  *          memmove(result, first, last -          result + (last -      template<>
     inline  *uninitialized_copy( *first,  *last,  *          memmove(result, first, last -          result + (last -      template<>
     inline wchar_t *uninitialized_copy( wchar_t *first,  wchar_t *last, wchar_t *          memmove(result, first, (last - first) *           result + (last -      template<>
     inline wchar_t *uninitialized_copy(wchar_t *first, wchar_t *last, wchar_t *          memmove(result, first, (last - first) *           result + (last -      template< InputIterator,  ForwardIterator,  T>
          ForwardIterator result, T*          typedef typename _type_traits<T>               template< InputIterator,  ForwardIterator>
             std::copy(first, last, result);
      template< InputIterator,  ForwardIterator>
            ForwardIterator cur =         
               (; first != last; ++first, ++                 construct(&*cur, *                        
     
     template< ForwardIterator,  T,  T1>
      _uninitialized_fill(ForwardIterator first, ForwardIterator last,  T& x, T1*     template< ForwardIterator,  T>
               T&     template< ForwardIterator,  T>
               T& 
     template< ForwardIterator,  T>
      uninitialized_fill(ForwardIterator first, ForwardIterator last,  T&        template< ForwardIterator,  T,  T1>
      _uninitialized_fill(ForwardIterator first, ForwardIterator last,  T& x, T1*          typedef typename _type_traits<T1>       template< ForwardIterator,  T>
               T&        template< ForwardIterator,  T>
               T&          ForwardIterator cur =          (; cur != last; ++             construct(&*  
     
     template< ForwardIterator,  Size,  T,  T1>
          Size n,  T& x, T1*     template< ForwardIterator,  Size,  T>
          Size n,  T&     template< ForwardIterator,  Size,  T>
          Size n,  T& 
     template< ForwardIterator,  Size,  T>
          Size n,  T&                template< ForwardIterator,  Size,  T,  T1>
          Size n,  T& x, T1*          typedef typename _type_traits<T1>               template< ForwardIterator,  Size,  T>
          Size n,  T&                template< ForwardIterator,  Size,  T>
          Size n,  T&          ForwardIterator cur =          (; n > ; --n, ++             construct(&*           
  

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved