aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/graph_base.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-04-21 17:29:37 +0800
committercrupest <crupest@outlook.com>2020-04-21 17:29:37 +0800
commit977baa3a42a8b813e75a3666809155604cb6713d (patch)
treefaa787e43fe8203139f79f8b39332584c1422a7d /include/cru/platform/graph_base.hpp
parent2898b68fc4f7ff40844ddf5a1d0b59f76b06290f (diff)
downloadcru-977baa3a42a8b813e75a3666809155604cb6713d.tar.gz
cru-977baa3a42a8b813e75a3666809155604cb6713d.tar.bz2
cru-977baa3a42a8b813e75a3666809155604cb6713d.zip
...
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) {}