From 4857feb9101ca4479f922040be17f27ee1486455 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Thu, 27 Jun 2024 16:30:45 +0200 Subject: [PATCH] libutil: add Bytes type not used anywhere yet, but we'll use this a lot soon for generators that return file contents, wire protocol fragments, or indeed any byte stream Change-Id: I01a46f9bf9d75aaf4a5d7662773b99f498862a28 --- src/libutil/types.hh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libutil/types.hh b/src/libutil/types.hh index 4974634d8..13cb062fb 100644 --- a/src/libutil/types.hh +++ b/src/libutil/types.hh @@ -11,6 +11,7 @@ #include #include #include +#include namespace nix { @@ -19,6 +20,10 @@ typedef std::set StringSet; typedef std::map StringMap; typedef std::map StringPairs; +// TODO this should be a std::byte span, but too much of the +// current codebase predates std::byte and uses char instead +using Bytes = std::span; + /** * Paths are just strings. */