From 8e7ce9d430b439995ceddca2c4fb9e24ed323d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sat, 30 Jul 2022 00:23:51 +0200 Subject: Add non-throwing variants of Query methods. Pl has also been refactored, so that the unnecessary throw and catch have been removed. --- c/pl.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'c/pl.cpp') diff --git a/c/pl.cpp b/c/pl.cpp index 6e71383..665fe3a 100644 --- a/c/pl.cpp +++ b/c/pl.cpp @@ -55,6 +55,10 @@ Query::~Query() PL_cut_query(m_q); } +int Query::Cut(std::nothrow_t) +{ + return PL_cut_query(m_q); +} int Query::Cut() { if (PL_cut_query(m_q)) return 1; @@ -63,6 +67,10 @@ int Query::Cut() } /* Cut query and invalidate associated data. */ +int Query::Close(std::nothrow_t) +{ + return PL_close_query(m_q); +} int Query::Close() { if (PL_close_query(m_q)) return 1; @@ -70,6 +78,10 @@ int Query::Close() return 0; } +int Query::NextSolution(std::nothrow_t) +{ + return PL_next_solution(m_q); +} int Query::NextSolution() { if (PL_next_solution(m_q)) return 1; -- cgit v1.2.3