From 114bee0381eea2e50a190620bace483299015856 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 24 Feb 2018 19:45:57 -0800 Subject: [PATCH] ircd::json: Add back support for tuple string reference indexing overloads. --- include/ircd/json/tuple/tuple.h | 68 +++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/include/ircd/json/tuple/tuple.h b/include/ircd/json/tuple/tuple.h index 8bb898ecd..208e571ed 100644 --- a/include/ircd/json/tuple/tuple.h +++ b/include/ircd/json/tuple/tuple.h @@ -157,6 +157,24 @@ indexof() return equal? i : indexof(); } +template +constexpr typename std::enable_if(), size_t>::type +indexof() +{ + return size(); +} + +template +constexpr typename std::enable_if(), size_t>::type +indexof() +{ + return indexof(); +} + template constexpr typename std::enable_if(), size_t>::type @@ -412,6 +430,40 @@ get(tuple &t, return defined(ret)? ret : def; } +template +enable_if_tuple()> &> +get(const tuple &t) +{ + return get(t); +} + +template +enable_if_tuple()>> +get(const tuple &t, + const tuple_value_type()> &def) +{ + return get(t, def); +} + +template +enable_if_tuple()>> +get(tuple &t) +{ + return get(t); +} + +template +enable_if_tuple()>> +get(tuple &t, + tuple_value_type()> &def) +{ + return get(t, def); +} + template enable_if_tuple()> &> @@ -460,6 +512,22 @@ at(tuple &t) return ret; } +template +enable_if_tuple()> &> +at(const tuple &t) +{ + return at(t); +} + +template +enable_if_tuple()> &> +at(tuple &t) +{ + return at(t); +} + template