A representation of the Spanner ENUM type: a protobuf enumeration.
A ProtoEnum<E> can be implicitly constructed from, and explicitly converted to an E. Values can be copied, assigned, compared for equality, and streamed.
Example
Given a proto definition enum Color { RED = 0; BLUE = 1; GREEN = 2; }:
auto e = spanner::ProtoEnum<Color>(BLUE);
assert(Color(e) == BLUE);
Constructors
ProtoEnum()
The default value is the first listed in the enum's definition.
ProtoEnum(enum_type)
Implicit construction from the enum type.
Parameter
Name
Description
v
enum_type
Operators
operator enum_type() const
Explicit conversion to the enum type.
Functions
static TypeName()
The fully-qualified name of the enum type, scope delimited by periods.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-22 UTC."],[[["\u003cp\u003eThis webpage provides documentation for the \u003ccode\u003eProtoEnum\u003c/code\u003e class within the Google Cloud Spanner C++ library, with the latest release candidate being 2.37.0-rc.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eProtoEnum\u003c/code\u003e class represents a protobuf enumeration and can be implicitly constructed from and explicitly converted to an enum type.\u003c/p\u003e\n"],["\u003cp\u003eUsers can access documentation for various versions of the library, ranging from 2.11.0 up to 2.36.0 and the latest release candidate 2.37.0-rc, along with detailed descriptions for each.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eProtoEnum\u003c/code\u003e class supports copying, assigning, comparing for equality, and streaming of enum values, with a default constructor set to the first value of the enum's definition.\u003c/p\u003e\n"],["\u003cp\u003eIt also provides the ability to obtain the fully-qualified name of the enum type and an implicit construction via a given enum type.\u003c/p\u003e\n"]]],[],null,[]]