This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 22b1ff6c17e98e5cb9f447685730b8618e9fc007
Author: Alan M. Carroll <[email protected]>
AuthorDate: Mon Jul 2 20:34:08 2018 -0500

    TextView: Add constexpr literal constructor for std::string_view.
    
    (cherry picked from commit 0225210345ec575c4ddbe37ed011e16f6e61738e)
---
 lib/ts/TextView.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/ts/TextView.h b/lib/ts/TextView.h
index a1a688f..d4494cd 100644
--- a/lib/ts/TextView.h
+++ b/lib/ts/TextView.h
@@ -1018,3 +1018,13 @@ namespace std
 {
 ostream &operator<<(ostream &os, const ts::TextView &b);
 }
+
+// @c constexpr literal constructor for @c std::string_view
+// For unknown reasons, this enables creating @c constexpr constructs using @c 
std::string_view while the standard
+// one (""sv) does not.
+// I couldn't think of any better place to put this, so it's here. At least @c 
TextView is strongly related
+// to @c std::string_view.
+constexpr std::string_view operator"" _sv(const char *s, size_t n)
+{
+  return {s, n};
+}

Reply via email to