Converting from protobuf to pmr datatypes

44 views
Skip to first unread message

Meibu

unread,
Mar 21, 2024, 9:13:47 AMMar 21
to Protocol Buffers
Hi all,

in C++ I currently use a google::protobuf::Map<std::string, std::string> that I can easily copy into an std::map<std::string, std::string> using iterators:

std::map<std::string, std::string> m{pm.my_map().begin(), pm.my_map().end()};

I want to do the same for an std::pmr::map<std::pmr::string, std::pmr::string>.

The iterator approach does not compile.

I can of course write a for loop and copy / insert each element individually.
But is there a smarter, shorter way?

Thanks!

Reply all
Reply to author
Forward
0 new messages