[ 
https://issues.apache.org/jira/browse/PROTON-2481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17472964#comment-17472964
 ] 

ASF GitHub Bot commented on PROTON-2481:
----------------------------------------

astitcher commented on a change in pull request #353:
URL: https://github.com/apache/qpid-proton/pull/353#discussion_r782359276



##########
File path: cpp/include/proton/map.hpp
##########
@@ -26,6 +26,8 @@
 #include "./internal/pn_unique_ptr.hpp"
 
 #include <cstddef>
+#include <initializer_list>
+#include <map>

Review comment:
       I'm not sure this is correct given my comment below - you may need pair 
though as that is used in the initializer_list constructor

##########
File path: cpp/include/proton/map.hpp
##########
@@ -79,6 +81,12 @@ class PN_CPP_CLASS_EXTERN map {
     /// Copy a map.
     PN_CPP_EXTERN map& operator=(const map&);
 
+    /// Copy a std::map.
+    PN_CPP_EXTERN map(const std::map<K, T>&);

Review comment:
       I think this is too specific: The assigment operator uses a template to 
take any argument that is assignable to a proton::value: as a map - this 
constructor should do the same.
   The assignment operator uses enable_if to ensure that it is the template 
type will work - I'm not sure you can use it in exactly the same way for a 
constructor. Actually I think we should replace the custom enable_if with 
std::enable_if now that we can use 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]


> [cpp] Improve constructor syntax for maps
> -----------------------------------------
>
>                 Key: PROTON-2481
>                 URL: https://issues.apache.org/jira/browse/PROTON-2481
>             Project: Qpid Proton
>          Issue Type: Improvement
>          Components: cpp-binding
>            Reporter: Rakhi Kumari
>            Assignee: Rakhi Kumari
>            Priority: Major
>             Fix For: proton-c-0.37.0
>
>




--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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

Reply via email to