From: Magnus Jacobsson Date: Wed, 7 Jul 2021 13:35:52 +0000 (+0200) Subject: add GVLayout construction overload, passing the graph as an rvalue ref X-Git-Tag: 2.49.0~28^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6439a79a2ff47412153aa2447da9d6951a56d54f;p=graphviz add GVLayout construction overload, passing the graph as an rvalue ref --- diff --git a/lib/gvc++/GVLayout.cpp b/lib/gvc++/GVLayout.cpp index 7ebad6f86..feab64aac 100644 --- a/lib/gvc++/GVLayout.cpp +++ b/lib/gvc++/GVLayout.cpp @@ -30,6 +30,10 @@ GVLayout::GVLayout(GVContext &&gvc, CGraph::AGraph &&g, : GVLayout(std::make_shared(std::move(gvc)), std::make_shared(std::move(g)), engine) {} +GVLayout::GVLayout(std::shared_ptr gvc, CGraph::AGraph &&g, + const std::string &engine) + : GVLayout(gvc, std::make_shared(std::move(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 9f851bffc..cffd80747 100644 --- a/lib/gvc++/GVLayout.h +++ b/lib/gvc++/GVLayout.h @@ -27,6 +27,8 @@ public: GVLayout(const std::shared_ptr &gvc, const std::shared_ptr &g, const std::string &engine); GVLayout(GVContext &&gvc, CGraph::AGraph &&g, const std::string &engine); + GVLayout(std::shared_ptr gvc, CGraph::AGraph &&g, + const std::string &engine); ~GVLayout(); // default copy since we manage resources through movable types