catch_noncopyable.hpp
1 2 // Copyright Catch2 Authors 3 // Distributed under the Boost Software License, Version 1.0. 4 // (See accompanying file LICENSE.txt or copy at 5 // https://www.boost.org/LICENSE_1_0.txt) 6 7 // SPDX-License-Identifier: BSL-1.0 8 #ifndef CATCH_NONCOPYABLE_HPP_INCLUDED 9 #define CATCH_NONCOPYABLE_HPP_INCLUDED 10 11 namespace Catch { 12 namespace Detail { 13 14 //! Deriving classes become noncopyable and nonmovable 15 class NonCopyable { 16 NonCopyable( NonCopyable const& ) = delete; 17 NonCopyable( NonCopyable&& ) = delete; 18 NonCopyable& operator=( NonCopyable const& ) = delete; 19 NonCopyable& operator=( NonCopyable&& ) = delete; 20 21 protected: 22 NonCopyable() noexcept = default; 23 }; 24 25 } // namespace Detail 26 } // namespace Catch 27 28 #endif // CATCH_NONCOPYABLE_HPP_INCLUDED