Skip to content

Commit 95cce64

Browse files
committed
Fix build issue on older compilers
The older compilers used in CI cannot deduce the type of the argument to std::optional::value_or()
1 parent dde2994 commit 95cce64

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/node/hlist.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace mfl
2323
{
2424
return std::ranges::fold_left_first(
2525
l.nodes | std::views::transform([](const node_variant& n) { return width(n); }), std::plus{})
26-
.value_or({});
26+
.value_or(dist_t{});
2727
}
2828

2929
dist_t hlist_depth(const hlist& l)

src/node/vlist.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ namespace mfl
99
{
1010
return std::ranges::fold_left_first(
1111
l.nodes | std::views::transform([](const node_variant& n) { return vsize(n); }), std::plus{})
12-
.value_or({});
12+
.value_or(dist_t{});
1313
}
1414
}

0 commit comments

Comments
 (0)