diff options
| author | Lukas Oesch <lukasoesch20@gmail.com> | 2026-05-05 14:37:47 +0200 |
|---|---|---|
| committer | Lukas Oesch <lukasoesch20@gmail.com> | 2026-05-05 14:38:53 +0200 |
| commit | 2ab9d6ffbc4aad8ab3a393bd32191e3c07103c0a (patch) | |
| tree | 12431e6abd1361740b85b4a7c22ab0af296a9d90 /kernel/include | |
| parent | 9aaabb2cf73f20cc4d4c68588e7bf4592837626f (diff) | |
| download | kernel-2ab9d6ffbc4aad8ab3a393bd32191e3c07103c0a.tar.xz kernel-2ab9d6ffbc4aad8ab3a393bd32191e3c07103c0a.zip | |
fix problem with string_view lifetime
Diffstat (limited to 'kernel/include')
| -rw-r--r-- | kernel/include/kernel/filesystem/path.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/include/kernel/filesystem/path.hpp b/kernel/include/kernel/filesystem/path.hpp index 976926f..298ac5f 100644 --- a/kernel/include/kernel/filesystem/path.hpp +++ b/kernel/include/kernel/filesystem/path.hpp @@ -3,6 +3,7 @@ #include <ranges> #include <string_view> +#include <kstd/string> namespace kernel::filesystem::path { @@ -43,12 +44,12 @@ namespace kernel::filesystem::path /** @brief Splits the given path into its components. @param path The path to split. - @return A range of string views representing the components of the path. + @return A range of strings representing the components of the path. */ auto inline split(std::string_view path) { return std::views::split(path, '/') | std::views::filter([](auto const & part) { return !part.empty(); }) | - std::views::transform([](auto const & part) { return std::string_view(part.begin(), part.end()); }); + std::views::transform([](auto const & part) { return kstd::string(std::string_view(part.begin(), part.end())); }); } } // namespace kernel::filesystem::path |
