Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 500 Bytes

README.md

File metadata and controls

27 lines (19 loc) · 500 Bytes

cpp-protoc-initializers

WORK IN PROGRESS

This plugin allows using aggregate initialization on Protocol Buffer generated classes.

Invocation: protoc --plugin=protoc-gen-cpp_initializers=<path_to_plugin> --cpp_initializers_out=. PROTO_FILES.

Example:

syntax = "proto3";

package foo;

message Message {
	int32 field;
}
template <typename T>
void foo(const typename T::initializable_type &message_) {
	T message(message_);
}

foo<package::Message>({.field = 2});