typedef in proto3 ?

43 views
Skip to first unread message

V R

unread,
Jan 26, 2022, 5:45:03 PMJan 26
to Protocol Buffers
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.

Deanna Garcia

unread,
Jan 26, 2022, 6:45:55 PMJan 26
to Protocol Buffers
We do not support typedefs in protobuf. We would like proto APIs to be as consistent as possible between languages, so we would not add a feature that is so C/C++ specific. If we were to do something like this, it would be a more generic version of type aliasing. See this thread for a conversation about support for type aliasing.
Reply all
Reply to author
Forward
0 new messages