Program Listing for File noDefaultMethods.h

Return to documentation for file (src/misc/pv/noDefaultMethods.h)

    EPICS_NOT_COPYABLE(MyClass)
public:
    ...
};
/* noDefaultMethods.h */
/*
 * Copyright information and license terms for this software can be
 * found in the file LICENSE that is included with the distribution
 */
#ifndef NO_DEFAULT_METHODS_H
#define NO_DEFAULT_METHODS_H

#include <shareLib.h>

#if __cplusplus>=201103L
#  define EPICS_NOT_COPYABLE(CLASS) private: CLASS(const CLASS&) = delete; CLASS& operator=(const CLASS&) = delete;
#else
#  define EPICS_NOT_COPYABLE(CLASS) private: CLASS(const CLASS&); CLASS& operator=(const CLASS&);
#endif

namespace epics { namespace pvData {

class NoDefaultMethods {
public:
    NoDefaultMethods() {}
private:
#if __cplusplus>=201103L
    NoDefaultMethods(const NoDefaultMethods&) = delete;
    NoDefaultMethods & operator=(const NoDefaultMethods &) = delete;
#else
    // do not implement
    NoDefaultMethods(const NoDefaultMethods&);
    NoDefaultMethods & operator=(const NoDefaultMethods &);
#endif
};

}}
#endif  /* NO_DEFAULT_METHODS_H */