@@ -264,14 +264,18 @@ StatusOr<T> MovedFromString(Value const& v) {
264264 return v.get <T>();
265265}
266266
267- template <typename T,
268- typename U = decltype (std::declval<google::bigtable::v2::Value>()
269- .string_value()),
270- typename std::enable_if<
271- std::is_same<std::remove_cv_t <std::remove_reference_t <U>>,
272- absl::Cord>::value>::type* = nullptr ,
273- typename std::enable_if_t <
274- !std::is_same<T, std::vector<std::string>>::value, int > = 0 >
267+ template <
268+ typename T,
269+ typename U =
270+ decltype (std::declval<google::bigtable::v2::Value>().string_value()),
271+ typename std::enable_if<
272+ std::is_same<std::remove_cv_t <std::remove_reference_t <U>>,
273+ absl::Cord>::value>::type* = nullptr ,
274+ typename std::enable_if_t <
275+ absl::disjunction<std::is_same<T, std::string>,
276+ std::is_same<T, absl::optional<std::string>>>::value,
277+ int > = 0 >
278+
275279StatusOr<T> MovedFromString (Value const &) {
276280 return T{" " };
277281}
@@ -292,6 +296,21 @@ StatusOr<T> MovedFromString(Value const& v) {
292296 return T{v2->size (), std::string{" " }};
293297}
294298
299+ template <typename T,
300+ typename U = decltype (std::declval<google::bigtable::v2::Value>()
301+ .string_value()),
302+ typename std::enable_if<
303+ std::is_same<std::remove_cv_t <std::remove_reference_t <U>>,
304+ absl::Cord>::value>::type* = nullptr ,
305+ typename std::enable_if_t <
306+ std::is_same<T, std::tuple<std::pair<std::string, std::string>,
307+ std::string>>::value,
308+ int > = 0 >
309+ StatusOr<T> MovedFromString (Value const &) {
310+ return std::tuple<std::pair<std::string, std::string>, std::string>{
311+ std::pair<std::string, std::string>(" name" , " " ), " " };
312+ }
313+
295314// NOTE: This test relies on unspecified behavior about the moved-from state
296315// of std::string. Specifically, this test relies on the fact that "large"
297316// strings, when moved-from, end up empty. And we use this fact to verify that
0 commit comments