2121#include < string>
2222#include < type_traits>
2323#include < utility>
24+ #include < variant>
2425
2526#include " google/protobuf/struct.pb.h"
2627#include " absl/base/attributes.h"
3738#include " absl/strings/string_view.h"
3839#include " absl/time/time.h"
3940#include " absl/types/optional.h"
40- #include " absl/types/variant.h"
4141#include " common/allocator.h"
4242#include " common/memory.h"
4343#include " common/optional_ref.h"
@@ -933,7 +933,7 @@ void StringRepeatedFieldAccessor(
933933 ABSL_DCHECK_LT (index, reflection->FieldSize (*message, field));
934934
935935 std::string scratch;
936- absl ::visit (
936+ std ::visit (
937937 absl::Overload (
938938 [&](absl::string_view string) {
939939 if (string.data () == scratch.data () &&
@@ -1000,7 +1000,7 @@ void BytesRepeatedFieldAccessor(
10001000 ABSL_DCHECK_LT (index, reflection->FieldSize (*message, field));
10011001
10021002 std::string scratch;
1003- absl ::visit (
1003+ std ::visit (
10041004 absl::Overload (
10051005 [&](absl::string_view string) {
10061006 if (string.data () == scratch.data () &&
@@ -1154,49 +1154,49 @@ struct OwningWellKnownTypesValueVisitor {
11541154 std::string* absl_nonnull scratch;
11551155
11561156 Value operator ()(well_known_types::BytesValue&& value) const {
1157- return absl ::visit (absl::Overload (
1158- [&](absl::string_view string) -> BytesValue {
1159- if (string.empty ()) {
1160- return BytesValue ();
1161- }
1162- if (scratch->data () == string.data () &&
1163- scratch->size () == string.size ()) {
1164- return BytesValue (arena, std::move (*scratch));
1165- }
1166- return BytesValue (arena, string);
1167- },
1168- [&](absl::Cord&& cord) -> BytesValue {
1169- if (cord.empty ()) {
1170- return BytesValue ();
1171- }
1172- return BytesValue (arena, cord);
1173- }),
1174- well_known_types::AsVariant (std::move (value)));
1157+ return std ::visit (absl::Overload (
1158+ [&](absl::string_view string) -> BytesValue {
1159+ if (string.empty ()) {
1160+ return BytesValue ();
1161+ }
1162+ if (scratch->data () == string.data () &&
1163+ scratch->size () == string.size ()) {
1164+ return BytesValue (arena, std::move (*scratch));
1165+ }
1166+ return BytesValue (arena, string);
1167+ },
1168+ [&](absl::Cord&& cord) -> BytesValue {
1169+ if (cord.empty ()) {
1170+ return BytesValue ();
1171+ }
1172+ return BytesValue (arena, cord);
1173+ }),
1174+ well_known_types::AsVariant (std::move (value)));
11751175 }
11761176
11771177 Value operator ()(well_known_types::StringValue&& value) const {
1178- return absl ::visit (absl::Overload (
1179- [&](absl::string_view string) -> StringValue {
1180- if (string.empty ()) {
1181- return StringValue ();
1182- }
1183- if (scratch->data () == string.data () &&
1184- scratch->size () == string.size ()) {
1185- return StringValue (arena, std::move (*scratch));
1186- }
1187- return StringValue (arena, string);
1188- },
1189- [&](absl::Cord&& cord) -> StringValue {
1190- if (cord.empty ()) {
1191- return StringValue ();
1192- }
1193- return StringValue (arena, cord);
1194- }),
1195- well_known_types::AsVariant (std::move (value)));
1178+ return std ::visit (absl::Overload (
1179+ [&](absl::string_view string) -> StringValue {
1180+ if (string.empty ()) {
1181+ return StringValue ();
1182+ }
1183+ if (scratch->data () == string.data () &&
1184+ scratch->size () == string.size ()) {
1185+ return StringValue (arena, std::move (*scratch));
1186+ }
1187+ return StringValue (arena, string);
1188+ },
1189+ [&](absl::Cord&& cord) -> StringValue {
1190+ if (cord.empty ()) {
1191+ return StringValue ();
1192+ }
1193+ return StringValue (arena, cord);
1194+ }),
1195+ well_known_types::AsVariant (std::move (value)));
11961196 }
11971197
11981198 Value operator ()(well_known_types::ListValue&& value) const {
1199- return absl ::visit (
1199+ return std ::visit (
12001200 absl::Overload (
12011201 [&](well_known_types::ListValueConstRef value) -> ListValue {
12021202 auto * cloned = value.get ().New (arena);
@@ -1215,7 +1215,7 @@ struct OwningWellKnownTypesValueVisitor {
12151215 }
12161216
12171217 Value operator ()(well_known_types::Struct&& value) const {
1218- return absl ::visit (
1218+ return std ::visit (
12191219 absl::Overload (
12201220 [&](well_known_types::StructConstRef value) -> MapValue {
12211221 auto * cloned = value.get ().New (arena);
@@ -1254,7 +1254,7 @@ struct BorrowingWellKnownTypesValueVisitor {
12541254 std::string* absl_nonnull scratch;
12551255
12561256 Value operator ()(well_known_types::BytesValue&& value) const {
1257- return absl ::visit (
1257+ return std ::visit (
12581258 absl::Overload (
12591259 [&](absl::string_view string) -> BytesValue {
12601260 if (string.data () == scratch->data () &&
@@ -1272,7 +1272,7 @@ struct BorrowingWellKnownTypesValueVisitor {
12721272 }
12731273
12741274 Value operator ()(well_known_types::StringValue&& value) const {
1275- return absl ::visit (
1275+ return std ::visit (
12761276 absl::Overload (
12771277 [&](absl::string_view string) -> StringValue {
12781278 if (string.data () == scratch->data () &&
@@ -1290,7 +1290,7 @@ struct BorrowingWellKnownTypesValueVisitor {
12901290 }
12911291
12921292 Value operator ()(well_known_types::ListValue&& value) const {
1293- return absl ::visit (
1293+ return std ::visit (
12941294 absl::Overload (
12951295 [&](well_known_types::ListValueConstRef value)
12961296 -> ParsedJsonListValue {
@@ -1309,7 +1309,7 @@ struct BorrowingWellKnownTypesValueVisitor {
13091309 }
13101310
13111311 Value operator ()(well_known_types::Struct&& value) const {
1312- return absl ::visit (
1312+ return std ::visit (
13131313 absl::Overload (
13141314 [&](well_known_types::StructConstRef value) -> ParsedJsonMapValue {
13151315 return ParsedJsonMapValue (&value.get (),
@@ -1360,7 +1360,7 @@ Value Value::FromMessage(
13601360 if (ABSL_PREDICT_FALSE (!status_or_adapted.ok ())) {
13611361 return ErrorValue (std::move (status_or_adapted).status ());
13621362 }
1363- return absl ::visit (
1363+ return std ::visit (
13641364 absl::Overload (OwningWellKnownTypesValueVisitor{
13651365 /* .arena = */ arena, /* .scratch = */ &scratch},
13661366 [&](std::monostate) -> Value {
@@ -1388,7 +1388,7 @@ Value Value::FromMessage(
13881388 if (ABSL_PREDICT_FALSE (!status_or_adapted.ok ())) {
13891389 return ErrorValue (std::move (status_or_adapted).status ());
13901390 }
1391- return absl ::visit (
1391+ return std ::visit (
13921392 absl::Overload (OwningWellKnownTypesValueVisitor{
13931393 /* .arena = */ arena, /* .scratch = */ &scratch},
13941394 [&](std::monostate) -> Value {
@@ -1418,7 +1418,7 @@ Value Value::WrapMessage(
14181418 if (ABSL_PREDICT_FALSE (!adapted_value.ok ())) {
14191419 return ErrorValue (std::move (adapted_value).status ());
14201420 }
1421- return absl ::visit (
1421+ return std ::visit (
14221422 absl::Overload (BorrowingWellKnownTypesValueVisitor{
14231423 /* .message = */ message, /* .arena = */ arena,
14241424 /* .scratch = */ &scratch},
@@ -1452,7 +1452,7 @@ Value Value::WrapMessageUnsafe(
14521452 if (ABSL_PREDICT_FALSE (!adapted_value.ok ())) {
14531453 return ErrorValue (std::move (adapted_value).status ());
14541454 }
1455- return absl ::visit (
1455+ return std ::visit (
14561456 absl::Overload (BorrowingWellKnownTypesValueVisitor{
14571457 /* .message = */ message, /* .arena = */ arena,
14581458 /* .scratch = */ &scratch},
@@ -1552,7 +1552,7 @@ Value WrapFieldImpl(
15521552 return BoolValue (reflection->GetBool (*message, field));
15531553 case google::protobuf::FieldDescriptor::TYPE_STRING : {
15541554 std::string scratch;
1555- return absl ::visit (
1555+ return std ::visit (
15561556 absl::Overload (
15571557 [&](absl::string_view string) -> StringValue {
15581558 if (string.data () == scratch.data () &&
@@ -1590,7 +1590,7 @@ Value WrapFieldImpl(
15901590 }
15911591 case google::protobuf::FieldDescriptor::TYPE_BYTES : {
15921592 std::string scratch;
1593- return absl ::visit (
1593+ return std ::visit (
15941594 absl::Overload (
15951595 [&](absl::string_view string) -> BytesValue {
15961596 if (string.data () == scratch.data () &&
@@ -1681,7 +1681,7 @@ Value WrapRepeatedFieldImpl(
16811681 return BoolValue (reflection->GetRepeatedBool (*message, field, index));
16821682 case google::protobuf::FieldDescriptor::TYPE_STRING : {
16831683 std::string scratch;
1684- return absl ::visit (
1684+ return std ::visit (
16851685 absl::Overload (
16861686 [&](absl::string_view string) -> StringValue {
16871687 if (string.data () == scratch.data () &&
@@ -1715,7 +1715,7 @@ Value WrapRepeatedFieldImpl(
17151715 }
17161716 case google::protobuf::FieldDescriptor::TYPE_BYTES : {
17171717 std::string scratch;
1718- return absl ::visit (
1718+ return std ::visit (
17191719 absl::Overload (
17201720 [&](absl::string_view string) -> BytesValue {
17211721 if (string.data () == scratch.data () &&
0 commit comments