diff options
Diffstat (limited to 'include/ricochet/net/sys/string_view_range.hh')
| -rw-r--r-- | include/ricochet/net/sys/string_view_range.hh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/ricochet/net/sys/string_view_range.hh b/include/ricochet/net/sys/string_view_range.hh new file mode 100644 index 0000000..84be394 --- /dev/null +++ b/include/ricochet/net/sys/string_view_range.hh @@ -0,0 +1,18 @@ +/** + * --------------------------------------------------------------------------- + * @notice This file was adapted from the Minnow networking framework, + * originally developed for Stanford University's CS144 course. + * It has been incorporated into the Ricochet project as foundational + * system utility code. + * --------------------------------------------------------------------------- + */ + +#pragma once + +#include <ranges> +#include <type_traits> + +// This concept represents any range (e.g. vector) whose elements can be converted to string_view. +template<typename R> +concept StringViewRange + = std::ranges::sized_range<R> && std::is_constructible_v<std::string_view, std::ranges::range_value_t<R>>; |
