aboutsummaryrefslogtreecommitdiff
path: root/src/common.h
diff options
context:
space:
mode:
authorkaiwu <kaiwu2004@gmail.com>2022-03-17 16:22:06 +0800
committerkaiwu <kaiwu2004@gmail.com>2022-03-17 16:22:06 +0800
commit6d0df82c81a01cacc3551ab525468da3b875ce41 (patch)
treec234db63ea1aaf5a83c67c896dfce969b2ab7dd0 /src/common.h
parenta6764bdef008bbaae7d8e02c67fa62fdd709c9ae (diff)
downloadadvent-of-code-6d0df82c81a01cacc3551ab525468da3b875ce41.tar.gz
advent-of-code-6d0df82c81a01cacc3551ab525468da3b875ce41.zip
call graph
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h
index 8d358cb..a88e16e 100644
--- a/src/common.h
+++ b/src/common.h
@@ -21,6 +21,10 @@ struct line_view {
return o;
}
+ bool operator<(const line_view& lv) const noexcept {
+ return std::string(line, length) < std::string(lv.line, lv.length);
+ }
+
bool operator==(const line_view& lv) const noexcept {
const char* p1 = line;
const char* p2 = lv.line;