From 37dceaa5db6e1de12cda7486be23b3d8d4a83fea Mon Sep 17 00:00:00 2001 From: Jesse Hoogervorst Date: Fri, 15 Dec 2023 10:44:18 +0100 Subject: [PATCH] Added explicit default move constructor/operator to Schema and Subschema to enable move semantics for these classes --- include/valijson/schema.hpp | 6 ++++++ include/valijson/subschema.hpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/include/valijson/schema.hpp b/include/valijson/schema.hpp index a3c3f24..1659efd 100644 --- a/include/valijson/schema.hpp +++ b/include/valijson/schema.hpp @@ -42,6 +42,12 @@ public: // Disable copy assignment Schema & operator=(const Schema &) = delete; + // Default move construction + Schema(Schema &&other) = default; + + // Disable copy assignment + Schema & operator=(Schema &&) = default; + /** * @brief Clean up and free all memory managed by the Schema * diff --git a/include/valijson/subschema.hpp b/include/valijson/subschema.hpp index b74806e..be71c44 100644 --- a/include/valijson/subschema.hpp +++ b/include/valijson/subschema.hpp @@ -43,6 +43,12 @@ public: // Disable copy assignment Subschema & operator=(const Subschema &) = delete; + // Default move construction + Subschema(Subschema &&) = default; + + // Default move assignment + Subschema & operator=(Subschema &&) = default; + /** * @brief Construct a new Subschema object */