From 947c061989fdc8cefce6802044e88d9d8dce05cf Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sat, 11 Dec 2021 15:12:22 -0800 Subject: [PATCH] C++options: Create QofQueryValue trait. --- libgnucash/app-utils/gnc-option-impl.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libgnucash/app-utils/gnc-option-impl.hpp b/libgnucash/app-utils/gnc-option-impl.hpp index fa92008a0d..702d62fbe8 100644 --- a/libgnucash/app-utils/gnc-option-impl.hpp +++ b/libgnucash/app-utils/gnc-option-impl.hpp @@ -230,6 +230,18 @@ struct is_QofInstanceValue template inline constexpr bool is_QofInstanceValue_v = is_QofInstanceValue::value; +template +struct is_QofQueryValue +{ + static constexpr bool value = + (std::is_same_v, GncOptionValue> || + std::is_same_v, + GncOptionValidatedValue>); +}; + +template inline constexpr bool +is_QofQueryValue_v = is_QofQueryValue::value; + /* These will work when m_value is a built-in class; GnuCash class and container * values will need specialization unless they happen to define operators << and * >>.