polybar-dwm/include/utils/mixins.hpp
Patrick Ziegler 56779a5902
Make the event loop return shared_ptrs (#2842)
* Return shared_ptr from eventloop

* Add -Wdeprecated-copy-dtor warning

Produces a warning if classes don't have explicit copy operations if
they have a user-defined constructor.
This helps us stick to the rule of 5 (kinda, no warnings for missing
move operators).

* Clean up eventloop

* Fix compiler warnings

* Fix fs_event_handle_t name
2022-10-15 23:21:40 +02:00

34 lines
638 B
C++

#pragma once
#include "common.hpp"
POLYBAR_NS
/**
* Base class for non copyable objects
*/
class non_copyable_mixin {
public:
non_copyable_mixin(const non_copyable_mixin&) = delete;
non_copyable_mixin& operator=(const non_copyable_mixin&) = delete;
protected:
non_copyable_mixin() = default;
~non_copyable_mixin() = default;
};
/**
* Base class for non movable objects
*/
class non_movable_mixin {
public:
non_movable_mixin(non_movable_mixin&&) = delete;
non_movable_mixin& operator=(non_movable_mixin&&) = delete;
protected:
non_movable_mixin() = default;
~non_movable_mixin() = default;
};
POLYBAR_NS_END