From 5acad7c8115a22354eab7c98f1f4b04c467702f8 Mon Sep 17 00:00:00 2001 From: Michael Gerhold Date: Tue, 14 Nov 2023 21:03:50 +0100 Subject: [PATCH] removed usage of `std::ranges::to` because emscripten doesn't yet support it --- src/values/builtin_function.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/values/builtin_function.hpp b/src/values/builtin_function.hpp index d02ef50..832798e 100644 --- a/src/values/builtin_function.hpp +++ b/src/values/builtin_function.hpp @@ -77,14 +77,14 @@ namespace values { using std::ranges::views::split; using std::ranges::views::transform; auto const separator = static_cast(values.at(1)->as_char_value().value()); - auto parts = values.front()->as_string().string_representation() | split(separator) - | filter([discard_empty](auto const& part) { - return not discard_empty or not std::string_view{ part }.empty(); - }) - | transform([](auto&& part) { - return String::make(std::string_view{ part }, ValueCategory::Lvalue); - }) - | std::ranges::to(); + auto parts_view = values.front()->as_string().string_representation() | split(separator) + | filter([discard_empty](auto const& part) { + return not discard_empty or not std::string_view{ part }.empty(); + }) + | transform([](auto&& part) { + return String::make(std::string_view{ part }, ValueCategory::Lvalue); + }); + auto parts = std::vector{ parts_view.begin(), parts_view.end() }; return Array::make(std::move(parts), ValueCategory::Rvalue); } throw WrongArgumentType{ to_view(m_type), "separator", values.at(1)->type() };