mirror of
https://github.com/NixOS/nix.git
synced 2025-11-13 22:12:43 +01:00
WIP initial design
This commit is contained in:
parent
a1f66d1d9e
commit
b798efb829
3 changed files with 19 additions and 10 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
#include <string_view>
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
@ -8,9 +9,7 @@ namespace nix {
|
|||
// separator, and modify the string argument to contain only the part after the
|
||||
// separator. Otherwise, wer return `std::nullopt`, and we leave the argument
|
||||
// string alone.
|
||||
std::optional<std::string_view> splitPrefix(std::string_view & string, char separator);
|
||||
|
||||
std::optional<std::string_view> splitPrefix(std::string_view & string, char separator) {
|
||||
static inline std::optional<std::string_view> splitPrefix(std::string_view & string, char separator) {
|
||||
auto sepInstance = string.find(separator);
|
||||
|
||||
if (sepInstance != std::string_view::npos) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue