Use constexpr for FieldTypeClass (#9434)
Otherwise in C++20 / VisualStudio 2022 the following warning is emitted: ``` warning C5054: operator '*': deprecated between enumerations of different types ```
This commit is contained in:
parent
a03ff9c3e8
commit
e554bd6cbf
@ -103,13 +103,11 @@ struct PROTOBUF_EXPORT FieldMetadata {
|
|||||||
};
|
};
|
||||||
// C++ protobuf has 20 fundamental types, were we added Cord and StringPiece
|
// C++ protobuf has 20 fundamental types, were we added Cord and StringPiece
|
||||||
// and also distinguish the same types if they have different wire format.
|
// and also distinguish the same types if they have different wire format.
|
||||||
enum {
|
static constexpr auto kCordType = 19;
|
||||||
kCordType = 19,
|
static constexpr auto kStringPieceType = 20;
|
||||||
kStringPieceType = 20,
|
static constexpr auto kInlinedType = 21;
|
||||||
kInlinedType = 21,
|
static constexpr auto kNumTypes = 21;
|
||||||
kNumTypes = 21,
|
static constexpr auto kSpecial = kNumTypes * kNumTypeClasses;
|
||||||
kSpecial = kNumTypes * kNumTypeClasses,
|
|
||||||
};
|
|
||||||
|
|
||||||
static int CalculateType(int fundamental_type, FieldTypeClass type_class);
|
static int CalculateType(int fundamental_type, FieldTypeClass type_class);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user