From: Magnus Jacobsson Date: Wed, 7 Jul 2021 13:55:08 +0000 (+0200) Subject: add GVLayout construction overload, passing the context as an rvalue ref X-Git-Tag: 2.49.0~28^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a783ab39701b9cea63f91148e6dd393c83cba7c5;p=graphviz add GVLayout construction overload, passing the context as an rvalue ref --- diff --git a/lib/gvc++/GVLayout.cpp b/lib/gvc++/GVLayout.cpp index feab64aac..a97574e41 100644 --- a/lib/gvc++/GVLayout.cpp +++ b/lib/gvc++/GVLayout.cpp @@ -34,6 +34,10 @@ GVLayout::GVLayout(std::shared_ptr gvc, CGraph::AGraph &&g, const std::string &engine) : GVLayout(gvc, std::make_shared(std::move(g)), engine) {} +GVLayout::GVLayout(GVContext &&gvc, std::shared_ptr g, + const std::string &engine) + : GVLayout(std::make_shared(std::move(gvc)), g, engine) {} + GVLayout::~GVLayout() { // m_gvc and m_g always either both point to an object or both are null assert((m_gvc != nullptr && m_g != nullptr) || diff --git a/lib/gvc++/GVLayout.h b/lib/gvc++/GVLayout.h index cffd80747..b961824da 100644 --- a/lib/gvc++/GVLayout.h +++ b/lib/gvc++/GVLayout.h @@ -29,6 +29,8 @@ public: GVLayout(GVContext &&gvc, CGraph::AGraph &&g, const std::string &engine); GVLayout(std::shared_ptr gvc, CGraph::AGraph &&g, const std::string &engine); + GVLayout(GVContext &&gvc, std::shared_ptr g, + const std::string &engine); ~GVLayout(); // default copy since we manage resources through movable types