astitcher commented on code in PR #382:
URL: https://github.com/apache/qpid-proton/pull/382#discussion_r1039820733


##########
cpp/src/map_test.cpp:
##########
@@ -114,6 +114,23 @@ void test_value() {
     ASSERT_THROWS(conversion_error, m.value(bad));
 }
 
+void test_copy_constructor() {
+    std::map<string, scalar> sm;
+    sm["a"] = 2;
+    sm["b"] = 3;
+    proton::map<string, scalar> m(sm);
+    ASSERT_EQUAL(scalar(2), m.get("a"));
+    ASSERT_EQUAL(scalar(3), m.get("b"));
+    ASSERT_EQUAL(2U, m.size());
+}
+
+void test_initializer_list_constructor() {
+    proton::map<string, scalar> m = {{"a", 2}, {"b", 3}};

Review Comment:
   as above this could be:
   `auto m = proton::map<string,scalar>{{"a", 2}, {"b", 3}};`
   Not sure this is definitely better, but perhaps more idiomatic post c++11.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to