From 2e2d1bd3b6c7776b77c33b94f30ead89367a71e6 Mon Sep 17 00:00:00 2001 From: Lexi Winter Date: Tue, 1 Jul 2025 17:07:04 +0100 Subject: add nihil.std --- nihil.util/skipws.ccm | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) (limited to 'nihil.util/skipws.ccm') diff --git a/nihil.util/skipws.ccm b/nihil.util/skipws.ccm index 4813ae8..0a15775 100644 --- a/nihil.util/skipws.ccm +++ b/nihil.util/skipws.ccm @@ -1,27 +1,14 @@ -/* - * This source code is released into the public domain. - */ - -module; - -#include -#include -#include -#include - +// This source code is released into the public domain. export module nihil.util:skipws; import :ctype; namespace nihil { -/* - * Remove leading whitespace from a string. - */ - -export template [[nodiscard]] -auto skipws(std::basic_string_view text, - std::locale const &locale = std::locale()) +// Remove leading whitespace from a string. +export template +[[nodiscard]] +auto skipws(std::basic_string_view text, std::locale const &locale = std::locale()) -> std::basic_string_view { auto is_space = ctype_is(std::ctype_base::space, locale); @@ -29,10 +16,8 @@ auto skipws(std::basic_string_view text, return {nonws, std::ranges::end(text)}; } -export template -auto skipws(std::basic_string_view *text, - std::locale const &locale = std::locale()) - -> void +export template +auto skipws(std::basic_string_view *text, std::locale const &locale = std::locale()) -> void { *text = skipws(*text, locale); } -- cgit v1.2.3