From ed893e6df95024a5b47e0dda2b86d830683a751d Mon Sep 17 00:00:00 2001 From: burgholzer Date: Wed, 24 Jan 2024 20:18:02 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=81=20try=20using=20shared=20pointers?= =?UTF-8?q?=20to=20fix=20windows=20compile=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: burgholzer --- include/mqt-core/parsers/qasm3_parser/Parser.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/mqt-core/parsers/qasm3_parser/Parser.hpp b/include/mqt-core/parsers/qasm3_parser/Parser.hpp index 0377ac3d8..d326862c3 100644 --- a/include/mqt-core/parsers/qasm3_parser/Parser.hpp +++ b/include/mqt-core/parsers/qasm3_parser/Parser.hpp @@ -29,13 +29,13 @@ namespace qasm3 { class MQT_CORE_EXPORT Parser { struct ScannerState { private: - std::unique_ptr is; + std::shared_ptr is; public: Token last{0, 0}; Token t{0, 0}; Token next{0, 0}; - std::unique_ptr scanner; + std::shared_ptr scanner; std::optional filename; bool isImplicitInclude; @@ -51,17 +51,17 @@ class MQT_CORE_EXPORT Parser { std::istream* in, std::optional debugFilename = std::nullopt, const bool implicitInclude = false) - : scanner(std::make_unique(in)), + : scanner(std::make_shared(in)), filename(std::move(debugFilename)), isImplicitInclude(implicitInclude) { scan(); } explicit ScannerState( - std::unique_ptr in, + std::shared_ptr in, std::optional debugFilename = std::nullopt, const bool implicitInclude = false) - : is(std::move(in)), scanner(std::make_unique(is.get())), + : is(std::move(in)), scanner(std::make_shared(is.get())), filename(std::move(debugFilename)), isImplicitInclude(implicitInclude) { scan(); @@ -120,7 +120,7 @@ class MQT_CORE_EXPORT Parser { scanner.emplace(is); scan(); if (implicitlyIncludeStdgates) { - scanner.emplace(std::make_unique(STDGATES), + scanner.emplace(std::make_shared(STDGATES), "stdgates.inc", true); scan(); }