mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-11-08 09:09:58 +00:00
general: Move deleted copy/move constructor/assignment operators to public interface
This allows for better compiler errors, where the compiler will state a copy or move couldn't occur due to the relevant function being deleted. Previously a compiler would warn about the relevant function not being accessible (which, while true, isn't as informative as it could be).
This commit is contained in:
parent
72add82ee9
commit
76d83ffbec
7 changed files with 9 additions and 11 deletions
|
@ -10,6 +10,7 @@
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
|
#include "common/common_funcs.h"
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "common/input.h"
|
#include "common/input.h"
|
||||||
#include "common/param_package.h"
|
#include "common/param_package.h"
|
||||||
|
|
|
@ -13,8 +13,6 @@
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "common/input.h"
|
#include "common/input.h"
|
||||||
#include "common/param_package.h"
|
#include "common/param_package.h"
|
||||||
#include "common/point.h"
|
|
||||||
#include "common/quaternion.h"
|
|
||||||
#include "common/settings.h"
|
#include "common/settings.h"
|
||||||
#include "common/vector_math.h"
|
#include "common/vector_math.h"
|
||||||
#include "core/hid/hid_types.h"
|
#include "core/hid/hid_types.h"
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
#include "common/common_funcs.h"
|
||||||
#include "core/hid/hid_types.h"
|
#include "core/hid/hid_types.h"
|
||||||
|
|
||||||
namespace Core::HID {
|
namespace Core::HID {
|
||||||
|
|
|
@ -20,8 +20,6 @@ class KernelCore;
|
||||||
class KProcess;
|
class KProcess;
|
||||||
|
|
||||||
#define KERNEL_AUTOOBJECT_TRAITS(CLASS, BASE_CLASS) \
|
#define KERNEL_AUTOOBJECT_TRAITS(CLASS, BASE_CLASS) \
|
||||||
YUZU_NON_COPYABLE(CLASS); \
|
|
||||||
YUZU_NON_MOVEABLE(CLASS); \
|
|
||||||
\
|
\
|
||||||
private: \
|
private: \
|
||||||
friend class ::Kernel::KClassTokenGenerator; \
|
friend class ::Kernel::KClassTokenGenerator; \
|
||||||
|
@ -32,6 +30,9 @@ private:
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
public: \
|
public: \
|
||||||
|
YUZU_NON_COPYABLE(CLASS); \
|
||||||
|
YUZU_NON_MOVEABLE(CLASS); \
|
||||||
|
\
|
||||||
using BaseClass = BASE_CLASS; \
|
using BaseClass = BASE_CLASS; \
|
||||||
static constexpr TypeObj GetStaticTypeObj() { \
|
static constexpr TypeObj GetStaticTypeObj() { \
|
||||||
constexpr ClassTokenType Token = ClassToken(); \
|
constexpr ClassTokenType Token = ClassToken(); \
|
||||||
|
@ -224,9 +225,9 @@ private:
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class KScopedAutoObject {
|
class KScopedAutoObject {
|
||||||
|
public:
|
||||||
YUZU_NON_COPYABLE(KScopedAutoObject);
|
YUZU_NON_COPYABLE(KScopedAutoObject);
|
||||||
|
|
||||||
public:
|
|
||||||
constexpr KScopedAutoObject() = default;
|
constexpr KScopedAutoObject() = default;
|
||||||
|
|
||||||
constexpr KScopedAutoObject(T* o) : m_obj(o) {
|
constexpr KScopedAutoObject(T* o) : m_obj(o) {
|
||||||
|
|
|
@ -16,13 +16,12 @@ class KernelCore;
|
||||||
class KProcess;
|
class KProcess;
|
||||||
|
|
||||||
class KAutoObjectWithListContainer {
|
class KAutoObjectWithListContainer {
|
||||||
|
public:
|
||||||
YUZU_NON_COPYABLE(KAutoObjectWithListContainer);
|
YUZU_NON_COPYABLE(KAutoObjectWithListContainer);
|
||||||
YUZU_NON_MOVEABLE(KAutoObjectWithListContainer);
|
YUZU_NON_MOVEABLE(KAutoObjectWithListContainer);
|
||||||
|
|
||||||
public:
|
|
||||||
using ListType = boost::intrusive::rbtree<KAutoObjectWithList>;
|
using ListType = boost::intrusive::rbtree<KAutoObjectWithList>;
|
||||||
|
|
||||||
public:
|
|
||||||
class ListAccessor : public KScopedLightLock {
|
class ListAccessor : public KScopedLightLock {
|
||||||
public:
|
public:
|
||||||
explicit ListAccessor(KAutoObjectWithListContainer* container)
|
explicit ListAccessor(KAutoObjectWithListContainer* container)
|
||||||
|
@ -48,7 +47,6 @@ public:
|
||||||
|
|
||||||
friend class ListAccessor;
|
friend class ListAccessor;
|
||||||
|
|
||||||
public:
|
|
||||||
KAutoObjectWithListContainer(KernelCore& kernel) : m_lock(kernel), m_object_list() {}
|
KAutoObjectWithListContainer(KernelCore& kernel) : m_lock(kernel), m_object_list() {}
|
||||||
|
|
||||||
void Initialize() {}
|
void Initialize() {}
|
||||||
|
|
|
@ -22,13 +22,12 @@ namespace Kernel {
|
||||||
class KernelCore;
|
class KernelCore;
|
||||||
|
|
||||||
class KHandleTable {
|
class KHandleTable {
|
||||||
|
public:
|
||||||
YUZU_NON_COPYABLE(KHandleTable);
|
YUZU_NON_COPYABLE(KHandleTable);
|
||||||
YUZU_NON_MOVEABLE(KHandleTable);
|
YUZU_NON_MOVEABLE(KHandleTable);
|
||||||
|
|
||||||
public:
|
|
||||||
static constexpr size_t MaxTableSize = 1024;
|
static constexpr size_t MaxTableSize = 1024;
|
||||||
|
|
||||||
public:
|
|
||||||
explicit KHandleTable(KernelCore& kernel_);
|
explicit KHandleTable(KernelCore& kernel_);
|
||||||
~KHandleTable();
|
~KHandleTable();
|
||||||
|
|
||||||
|
|
|
@ -28,10 +28,10 @@ class Layer;
|
||||||
|
|
||||||
/// Represents a single display type
|
/// Represents a single display type
|
||||||
class Display {
|
class Display {
|
||||||
|
public:
|
||||||
YUZU_NON_COPYABLE(Display);
|
YUZU_NON_COPYABLE(Display);
|
||||||
YUZU_NON_MOVEABLE(Display);
|
YUZU_NON_MOVEABLE(Display);
|
||||||
|
|
||||||
public:
|
|
||||||
/// Constructs a display with a given unique ID and name.
|
/// Constructs a display with a given unique ID and name.
|
||||||
///
|
///
|
||||||
/// @param id The unique ID for this display.
|
/// @param id The unique ID for this display.
|
||||||
|
|
Loading…
Reference in a new issue