The uncopyable (a. k. a. non-copyable) Mixin idiom as a C++11 component.
fw::core::UncopyableMixin is an adoption of Item 6: Explicitly disallow the use of compiler-generated functions you do not want from the book Effective C++: 55 Specific Ways to Improve Your Programs and Designs by Scott Meyers.
The implementation uses the following idioms:
fw::core::UncopyableMixin is a modern version of boost::noncopyable:
-
Allows for Empty Base Optimization with multiple inheritance.
-
Clean code, e. g. no usage of preprocessor macros.
-
Natural name which cleanly indicates its purpose:
"It's a fine class, I just find the name a bit un-, er, nonnatural."
-- S. Meyer: Effective C++. Boston: Pearson Education, 2008, p. 39
WIP: Biicode integration is coming!
#include "fw/core/uncopyable_mixin.h"
class MyUncopyable final : private fw::core::UncopyableMixin<MyUncopyable> {
};
mkdir build && cmake .. && make && ctest
Please see CONTRIBUTING for details.
Copyright Florian Wolters 2014 (http://blog.florianwolters.de).
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)