aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/graph_base.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/platform/graph_base.hpp')
-rw-r--r--include/cru/platform/graph_base.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/cru/platform/graph_base.hpp b/include/cru/platform/graph_base.hpp
index f25a7baf..0b997770 100644
--- a/include/cru/platform/graph_base.hpp
+++ b/include/cru/platform/graph_base.hpp
@@ -218,6 +218,11 @@ struct TextRange final {
return TextRange(start, end - start);
}
+ constexpr static TextRange FromTwoSides(gsl::index start, gsl::index end,
+ gsl::index offset) {
+ return TextRange(start + offset, end - start);
+ }
+
constexpr TextRange() = default;
constexpr TextRange(const gsl::index position, const gsl::index count = 0)
: position(position), count(count) {}