FlorianWolters / cpp-component-core-uncopyable

The uncopyable (non-copyable) Mixin idiom as a reusable C++11 component.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fw::core::UncopyableMixin

The uncopyable (a. k. a. non-copyable) Mixin idiom as a C++11 component.

Build Status

Table of Contents (ToC)

Introduction

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:

Features

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

Requirements

Production

Development

Installation

WIP: Biicode integration is coming!

Usage

#include "fw/core/uncopyable_mixin.h"

class MyUncopyable final : private fw::core::UncopyableMixin<MyUncopyable> {
};

Testing

mkdir build && cmake .. && make && ctest

Contributing

Please see CONTRIBUTING for details.

Credits

License

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)

About

The uncopyable (non-copyable) Mixin idiom as a reusable C++11 component.

License:Boost Software License 1.0


Languages

Language:C++ 100.0%