Copy a std::vector to a repeated field from protobuf with memcpy

后端 未结 3 1620
再見小時候
再見小時候 2020-12-15 06:49

At first I have this simple protobuf file

message messagetest
{
    ...
    repeated float samples = 6;
    ....
}

Which creates a headerfi

3条回答
  •  悲哀的现实
    2020-12-15 07:29

    Since this isn't here yet and I like one-liners:

    *fMessage.mutable_samples() = {fData.begin(), fData.end()};
    

提交回复
热议问题