template class mrpt::containers::NonCopiableData

Overview

A wrapper for a piece of data of type T which should not be copied or moved by default operator =().

Useful for instance to hold a std::mutex or alike within a class or structure with other regular data fields for which the default operator =() is desired.

#include <mrpt/containers/NonCopiableData.h>

template <class T>
class NonCopiableData
{
public:
    // fields

    T data;

    // construction

    NonCopiableData();
    NonCopiableData(const NonCopiableData&);
    NonCopiableData(NonCopiableData&&);

    // methods

    NonCopiableData& operator = (const NonCopiableData&);
    NonCopiableData& operator = (NonCopiableData&&);
};