mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
6fbe3c6055
* Make noncopyable constructor and destructor default C++11 provides the functionality. Defining empty functions cause all classes derived from noncopyable to be non-trivially constructible and non-trivially destructible. For example, matrix with compile-time layout by definition does not require an explicit destructor and should be trivially destructible ; however, deriving from noncopyable makes it non-trivially destrutible. This also affects vector<T, 2> and vector<T, 3>. * Delete array2d copy constructor and assignment operators
33 lines
933 B
C++
33 lines
933 B
C++
// (C) Copyright Beman Dawes 1999-2003. Distributed under the Boost
|
|
// Software License, Version 1.0. (See accompanying file
|
|
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
// Contributed by Dave Abrahams
|
|
// See http://www.boost.org/libs/utility for documentation.
|
|
|
|
#ifndef DLIB_BOOST_NONCOPYABLE_HPP_INCLUDED
|
|
#define DLIB_BOOST_NONCOPYABLE_HPP_INCLUDED
|
|
|
|
|
|
namespace dlib
|
|
{
|
|
class noncopyable
|
|
{
|
|
/*!
|
|
This class makes it easier to declare a class as non-copyable.
|
|
If you want to make an object that can't be copied just inherit
|
|
from this object.
|
|
!*/
|
|
|
|
protected:
|
|
noncopyable() = default;
|
|
~noncopyable() = default;
|
|
private: // emphasize the following members are private
|
|
noncopyable(const noncopyable&);
|
|
const noncopyable& operator=(const noncopyable&);
|
|
|
|
};
|
|
}
|
|
|
|
#endif // DLIB_BOOST_NONCOPYABLE_HPP_INCLUDED
|
|
|