diff options
author | crupest <crupest@outlook.com> | 2020-04-21 17:29:37 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-04-21 17:29:37 +0800 |
commit | 977baa3a42a8b813e75a3666809155604cb6713d (patch) | |
tree | faa787e43fe8203139f79f8b39332584c1422a7d /include/cru/platform/graph_base.hpp | |
parent | 2898b68fc4f7ff40844ddf5a1d0b59f76b06290f (diff) | |
download | cru-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.hpp | 5 |
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) {} |