home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tlx501.zip / TEMPLATE / VECTOR.CPP < prev   
C/C++ Source or Header  |  1996-01-05  |  3KB  |  85 lines

  1. /****************************************************************************
  2.     $Id: vector.cpp 501.0 1995/03/07 12:27:04 RON Exp $
  3.  
  4.     Copyright (c) 1991-95 Tarma Software Research. All rights reserved.
  5.  
  6.     Project:    Tarma Library for C++ V5.0
  7.     Author:    Ron van der Wal
  8.  
  9.     Implementation of class TLVector<T>.
  10.  
  11.     $Log: vector.cpp $
  12.     Revision 501.0  1995/03/07 12:27:04  RON
  13.     Updated for TLX 5.01
  14.     Revision 1.5  1995/01/31 16:30:54  RON
  15.     Update for release 012
  16.     Added partial support for SunPro C++ compiler
  17.     Revision 1.4  1994/09/28  14:43:22  ron
  18.     Removed Macintosh-style #include references
  19.  
  20.     Revision 1.3  1994/09/27  20:27:51  ron
  21.     Changed path separator from / to \
  22.  
  23.     Revision 1.2  1994/09/26  15:37:29  ron
  24.     Changed include file references
  25.  
  26.     Revision 1.1  1994/08/16  18:15:37  ron
  27.     Initial revision
  28.  
  29. ****************************************************************************/
  30.  
  31. #ifndef __VECTOR_CPP
  32. #define __VECTOR_CPP
  33.  
  34. //----- Project headers
  35.  
  36. #ifndef _TLX_ARRAYS_H
  37. #include <tlx\501\arrays.h>
  38. #endif
  39.  
  40. #ifndef _TLX_VBASE_CPP
  41. #include <tlx\501\template\vbase.cpp>
  42. #endif
  43.  
  44. /*-------------------------------------------------------------------------*/
  45.     template<class T> TLVector<T>::TLVector(size_t size)
  46.  
  47. /*  Constructor creating a vector with the given size.
  48. ---------------------------------------------------------------------------*/
  49. : TLVBase<T>(size)
  50. {
  51. }
  52.  
  53. /*-------------------------------------------------------------------------*/
  54.     template<class T> TLVector<T>::TLVector(const T &t)
  55.  
  56. /*  Constructor creating a vector consisting of a single element.
  57. ---------------------------------------------------------------------------*/
  58. : TLVBase<T>(t)
  59. {
  60. }
  61.  
  62. /*-------------------------------------------------------------------------*/
  63.     template<class T> TLVector<T>::TLVector(const T *t, size_t sz)
  64.  
  65. /*  Constructor creating a vector that is a copy of a C-style vector of
  66.     a given size.
  67. ---------------------------------------------------------------------------*/
  68. : TLVBase<T>(t, sz)
  69. {
  70. }
  71.  
  72. /*-------------------------------------------------------------------------*/
  73.     template<class T>
  74.     TLVector<T> &TLVector<T>::operator =(const TLVector<T> &s)
  75.  
  76. /*  Overloading of the assignment operator.
  77. ---------------------------------------------------------------------------*/
  78. {
  79.     if (this != &s)
  80.     TLVBase<T>::operator =(s);
  81.     return *this;
  82. }
  83.  
  84. #endif    // __VECTOR_CPP
  85.