home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bc45 / classinc.pak / VOIDP.H < prev   
C/C++ Source or Header  |  1997-07-23  |  1KB  |  47 lines

  1. /*------------------------------------------------------------------------*/
  2. /*                                                                        */
  3. /*  VOIDP.H                                                               */
  4. /*                                                                        */
  5. /*  Copyright (c) 1993, 1994 Borland International                        */
  6. /*  All Rights Reserved                                                   */
  7. /*                                                                        */
  8. /*------------------------------------------------------------------------*/
  9.  
  10. #if !defined( CLASSLIB_VOIDP_H )
  11. #define CLASSLIB_VOIDP_H
  12.  
  13. #if !defined( CLASSLIB_DEFS_H )
  14. #include <classlib/defs.h>
  15. #endif
  16.  
  17. #if defined( BI_CLASSLIB_NO_po )
  18. #pragma option -po-
  19. #endif
  20.  
  21. class TVoidPointer
  22. {
  23.  
  24. public:
  25.  
  26.     TVoidPointer( const void *p = 0 ) : Ptr(p) {}
  27.     TVoidPointer( const TVoidPointer& rp ) : Ptr(rp.Ptr) {}
  28.  
  29.     const TVoidPointer& operator = ( const TVoidPointer& vp )
  30.         { Ptr = vp.Ptr; return *this; }
  31.     const TVoidPointer& operator = ( const void *p )
  32.         { Ptr = p; return *this; }
  33.     operator void *() const { return CONST_CAST(void *,Ptr); }
  34.  
  35. private:
  36.  
  37.     const void *Ptr;
  38.  
  39. };
  40.  
  41. #if defined( BI_CLASSLIB_NO_po )
  42. #pragma option -po.
  43. #endif
  44.  
  45. #endif  // CLASSLIB_VOIDP_H
  46.  
  47.