Skip to content

Commit 6ac117d

Browse files
committed
Make convert operator to be compatible with constant expressions
1 parent 69a98f5 commit 6ac117d

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

include/slimcpplib/long_int.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,7 @@ template<typename native_t, uint_t size>
217217
template<uint_t other_size, std::enable_if_t<(other_size < size), int>>
218218
constexpr long_int_t<native_t, size>::operator long_int_t<native_t, other_size>() const noexcept
219219
{
220-
long_int_t<native_t, other_size> tmp;
221-
222-
for (uint_t n = 0; n < other_size; ++n)
223-
tmp.digits[n] = digits[n];
224-
225-
return tmp;
220+
return make_array<other_size>(digits, [](const auto& digits, uint_t idx) { return digits[idx]; });
226221
}
227222

228223

0 commit comments

Comments
 (0)