mirror of
https://github.com/Z3Prover/z3
synced 2026-02-19 15:04:42 +00:00
Adopt std::optional for try_get_value and try_get_size functions (#8268)
* Initial plan * Convert try_get_value and try_get_size to use std::optional Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Add unit tests for std::optional conversions and fix compilation error Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Address code review comments - improve readability and reduce code duplication Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
parent
671faf8f1c
commit
054a83e925
14 changed files with 92 additions and 44 deletions
|
|
@ -50,7 +50,10 @@ namespace datalog {
|
|||
|
||||
sort_domain(sort_kind k, context & ctx, sort * s)
|
||||
: m_kind(k), m_sort(s, ctx.get_manager()) {
|
||||
m_limited_size = ctx.get_decl_util().try_get_size(s, m_size);
|
||||
auto opt_size = ctx.get_decl_util().try_get_size(s);
|
||||
m_limited_size = opt_size.has_value();
|
||||
if (m_limited_size)
|
||||
m_size = *opt_size;
|
||||
}
|
||||
public:
|
||||
virtual ~sort_domain() = default;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue