Skip to content

Commit 17752d3

Browse files
committed
Use std::optional in struct_encodingt
1 parent 570ef6e commit 17752d3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/solvers/smt2_incremental/encoding/struct_encoding.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include <algorithm>
1717
#include <numeric>
18+
#include <optional>
1819
#include <queue>
1920

2021
struct_encodingt::struct_encodingt(const namespacet &ns)
@@ -33,7 +34,7 @@ struct_encodingt::~struct_encodingt() = default;
3334
/// If the given \p type needs re-encoding as a bit-vector then this function
3435
/// \returns the width of the new bitvector type. The width calculation is
3536
/// delegated to \p boolbv_width.
36-
static optionalt<std::size_t>
37+
static std::optional<std::size_t>
3738
needs_width(const typet &type, const boolbv_widtht &boolbv_width)
3839
{
3940
if(const auto struct_tag = type_try_dynamic_cast<struct_tag_typet>(type))
@@ -222,7 +223,7 @@ exprt struct_encodingt::encode(exprt expr) const
222223
if(can_cast_type<struct_tag_typet>(current.type()))
223224
current = ::encode(*with_expr, ns);
224225
current.type() = encode(current.type());
225-
optionalt<exprt> update;
226+
std::optional<exprt> update;
226227
if(const auto struct_expr = expr_try_dynamic_cast<struct_exprt>(current))
227228
update = ::encode(*struct_expr);
228229
if(const auto union_expr = expr_try_dynamic_cast<union_exprt>(current))

0 commit comments

Comments
 (0)