diff --git a/library/include/larra/stream_error.hpp b/library/include/larra/stream_error.hpp index e6d080f..8f1b500 100644 --- a/library/include/larra/stream_error.hpp +++ b/library/include/larra/stream_error.hpp @@ -56,10 +56,8 @@ struct ErrorImpl : BaseError { static constexpr auto str = [] { return std::array{std::string_view{"Stream Error: "}, nameof::nameof_short_type(), std::string_view{"\0", 1}} | std::views::join; }; - constexpr auto size = std::ranges::fold_left(str(), std::size_t{}, [](auto accum, auto) { - return accum + 1; - }); - static constexpr auto array = [] { + constexpr auto size = std::ranges::distance(str()); + static constexpr auto array = [&] { std::array response; // NOLINT std::ranges::copy(str(), response.begin()); return response;