#ifndef NONCOPYABLE_HPP
#define NONCOPYABLE_HPP
// Private copy constructor and copy assignment ensure classes derived from
// class noncopyable cannot be copied.
class noncopyable
{
protected:
#if __cplusplus >= 201103L
constexpr noncopyable() = default;
~noncopyable() = default;
#else
noncopyable() {}
~noncopyable() {}
#endif
#if __cplusplus >= 201103L
noncopyable( const noncopyable& ) = delete;
noncopyable& operator=( const noncopyable& ) = delete;
#else
private: // emphasize the following members are private
noncopyable( const noncopyable& );
noncopyable& operator=( const noncopyable& );
#endif
};
#endif//NONCOPYABLE_HPP
C++不可拷貝基類的實現,學習自BOOST庫