Changeset 265


Ignore:
Timestamp:
Dec 6, 2002, 6:15:49 PM (18 years ago)
Author:
pooh
Message:
  • Added macros to allow conveniently disable copy constructor and assignment

for a class.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/libp++/pxx_common.hh

    r261 r265  
    7878  }
    7979
     80#define NO_COPY_CTOR(cls) \
     81  cls () \
     82  { \
     83    FATAL("Copy constructor is not allowed for this class"); \
     84  }
     85
     86#define NO_ASSIGN(cls) \
     87  cls& operator = (cls const&) \
     88  { \
     89    FATAL("Assignment is not allowed for this class"); \
     90    return self; \
     91  }
     92
    8093extern unsigned debug_level ;
    8194
Note: See TracChangeset for help on using the changeset viewer.