home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 31 / CDASC_31_1996_juillet_aout.iso / vrac / cuj0796.zip / PLAUGER.ZIP / MEMORY2 next >
Text File  |  1996-04-24  |  776b  |  22 lines

  1. --------------- Listing 1: <memory>, part 2 -------------
  2.  
  3.         // TEMPLATE FUNCTION uninitialized_copy
  4. template<class InIt, class FwdIt> inline
  5.     FwdIt uninitialized_copy(InIt first, InIt last, FwdIt x)
  6.     {for (; first != last; ++x, ++first)
  7.         _Construct(&*x, *first);
  8.     return (x); }
  9.  
  10.         // TEMPLATE FUNCTION uninitialized_fill
  11. template<class FwdIt, class T> inline
  12.     void uninitialized_fill(FwdIt first, FwdIt last, const T& x)
  13.     {for (; first != last; ++first)
  14.         _Construct(&*first, x); }
  15.  
  16.         // TEMPLATE FUNCTION uninitialized_fill_n
  17. template<class FwdIt, class Size, class T> inline
  18.     void uninitialized_fill_n(FwdIt first, Size n, const T& x)
  19.     {for (; 0 < n; --n, ++first)
  20.         _Construct(&*first, x); }
  21.  
  22.