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

  1. /****************************************************************************
  2.     $Id: assoc.cpp 501.0 1995/03/07 12:26:56 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 TLAssoc<K,V>.
  10.  
  11.     $Log: assoc.cpp $
  12.     Revision 501.0  1995/03/07 12:26:56  RON
  13.     Updated for TLX 5.01
  14.     Revision 1.5  1995/01/31 16:30:42  RON
  15.     Update for release 012
  16.     Added partial support for SunPro C++ compiler
  17.     Revision 1.4  1994/09/28  14:40:15  ron
  18.     Removed Macintosh-style #include references
  19.  
  20.     Revision 1.3  1994/09/27  20:27:07  ron
  21.     Changed path separator from / to \
  22.  
  23.     Revision 1.2  1994/09/26  15:28:49  ron
  24.     Changed include file references
  25.  
  26.     Revision 1.1  1994/08/16  18:15:23  ron
  27.     Initial revision
  28.  
  29. ****************************************************************************/
  30.  
  31. #ifndef _TLX_ASSOC_CPP
  32. #define _TLX_ASSOC_CPP
  33.  
  34. #ifndef _TLX_ASSOC_H
  35. #include <tlx\501\assoc.h>
  36. #endif
  37.  
  38. //-----    Friend functions
  39.  
  40. template<class K, class V>
  41. ostream &operator <<(ostream &os, const TLAssoc<K,V> &as)
  42. {
  43. //    return os << "[ " << as.mKey << " | " << as.mValue << " ]";
  44.     return os << "[ | ]";
  45. }
  46.  
  47. template<class K, class V>
  48. int operator ==(const TLAssoc<K,V> &as1, const TLAssoc<K,V> &as2)
  49. {
  50.     return as1.mKey == as2.mKey;
  51. }
  52.  
  53. template<class K, class V> int operator ==(const TLAssoc<K,V> &as, const K &k)
  54. {
  55.      return as.mKey == k;
  56. }
  57.  
  58. template<class K, class V> int operator ==(const K &k, const TLAssoc<K,V> &as)
  59. {
  60.      return as.mKey == k;
  61. }
  62.  
  63. #endif    // _TLX_ASSOC_CPP
  64.