Commit 34a67368 authored by Dominik Charousset's avatar Dominik Charousset

Integrate review feedback

parent 23735244
...@@ -34,10 +34,11 @@ message to_message_impl(size_t storage_size, TypeListBuilder& types, ...@@ -34,10 +34,11 @@ message to_message_impl(size_t storage_size, TypeListBuilder& types,
intrusive_cow_ptr<message_data> ptr{raw_ptr, false}; intrusive_cow_ptr<message_data> ptr{raw_ptr, false};
auto storage = raw_ptr->storage(); auto storage = raw_ptr->storage();
for (auto& element : elements) { for (auto& element : elements) {
if constexpr (Policy == move_msg) if constexpr (Policy == move_msg) {
storage = element->move_init(storage); storage = element->move_init(storage);
else } else {
storage = element->copy_init(storage); storage = element->copy_init(storage);
}
raw_ptr->inc_constructed_elements(); raw_ptr->inc_constructed_elements();
} }
return message{std::move(ptr)}; return message{std::move(ptr)};
......
...@@ -75,10 +75,7 @@ SCENARIO("message builders allows RAII types") { ...@@ -75,10 +75,7 @@ SCENARIO("message builders allows RAII types") {
CHECK_EQ(to_string(msg.types()), "[std::string]"); CHECK_EQ(to_string(msg.types()), "[std::string]");
using view_t = const_typed_message_view<std::string>; using view_t = const_typed_message_view<std::string>;
if (auto tup = view_t(msg); CHECK(tup)) { if (auto tup = view_t(msg); CHECK(tup)) {
auto& str = get<0>(tup); CHECK_EQ(get<0>(tup), quote);
MESSAGE("str: " << str);
MESSAGE("quote: " << quote);
CHECK_EQ(str, quote);
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment