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-14 UTC."],[[["\u003cp\u003eThis page details the \u003ccode\u003eProtoEnum\u003c/code\u003e class in the Google Cloud Spanner C++ library, which represents a protobuf enumeration.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version available is 2.37.0-rc, and the document provides links to versions ranging from 2.37.0-rc down to 2.11.0.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eProtoEnum\u003c/code\u003e can be constructed implicitly from an enum type \u003ccode\u003eE\u003c/code\u003e and converted explicitly back to an \u003ccode\u003eE\u003c/code\u003e, allowing for operations like copying, assignment, comparison, and streaming.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eProtoEnum\u003c/code\u003e includes a default constructor that sets the value to the first listed item in the enum's definition and a method \u003ccode\u003eTypeName()\u003c/code\u003e to get the fully qualified name of the enum type.\u003c/p\u003e\n"],["\u003cp\u003eThe alias \u003ccode\u003eenum_type\u003c/code\u003e refers to the underlying \u003ccode\u003eE\u003c/code\u003e type.\u003c/p\u003e\n"]]],[],null,[]]