does typedef exist in protobuf ?

80 views
Skip to first unread message

V R

unread,
Jan 26, 2022, 5:44:14 PM1/26/22
to grpc.io
Hi, 
I'd like to define a typedef as in C/C++, e.g:
typedef list<double> DoubleVector 

How can I declare that in a proto3 file ?  

I know I can use:
message ListOfDouble {
 repeated double value = 1;
}

But I'd like not to use that if possible in order to have a container of some type.
Thanks.

Easwar Swaminathan

unread,
Feb 2, 2022, 1:32:40 PM2/2/22
to grpc.io
This is a protobuf question and not gRPC specific. Please ask in the protobuf mailing list.

FWIW, `repeated` sounds appropriate for your use case. You can have have a `repeated` field of scalar types or custom types.
Reply all
Reply to author
Forward
0 new messages