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

Andrew Stitcher commented on PROTON-1629:
-----------------------------------------

Actually the compile error is that there is not a *copy* assignment, and there 
cannot be one because pn_unique_ptr can only be moved and never copied.

Why the compiler isn't trying to use a move assignment/constructor does not 
appear obvious to me at this point - I shall think about it some more!

> [cpp] proton::container is not move constructible
> -------------------------------------------------
>
>                 Key: PROTON-1629
>                 URL: https://issues.apache.org/jira/browse/PROTON-1629
>             Project: Qpid Proton
>          Issue Type: Improvement
>          Components: cpp-binding
>    Affects Versions: proton-c-0.18.0
>         Environment: Linux, gcc (GCC) 7.0.1 20170409 (experimental), git tip 
> at 
> commit 72b7ea0508e94aae3e5d9470293bc5c7e8250a45 (upstream/master)
>      PROTON-1592: [python] restore original tx_recv.py example
>            Reporter: Jiri Daněk
>            Assignee: Andrew Stitcher
>            Priority: Minor
>             Fix For: proton-c-0.20.0
>
>
> Following C++11 code does not compile
> {code}
>     auto handler = proton::messaging_handler();
>     auto container = proton::container(handler); // container is not move 
> constructible
> {code}
> Error from GCC is
> {noformat}
> /home/jdanek/Work/repos/qpid-proton/proton-c/bindings/cpp/src/container_test.cpp:
>  In function ‘int {anonymous}::test_container_schedule_multithreaded()’:
> /home/jdanek/Work/repos/qpid-proton/proton-c/bindings/cpp/src/container_test.cpp:591:47:
>  error: use of deleted function ‘proton::container::container(const 
> proton::container&)’
>      auto container = proton::container(handler); // container is not move 
> constructible
>                                                ^
> In file included from 
> /home/jdanek/Work/repos/qpid-proton/proton-c/bindings/cpp/src/container_test.cpp:28:0:
> /home/jdanek/Work/repos/qpid-proton/proton-c/bindings/cpp/include/proton/container.hpp:55:27:
>  note: ‘proton::container::container(const proton::container&)’ is implicitly 
> deleted because the default definition would be ill-formed:
>  class PN_CPP_CLASS_EXTERN container {
>                            ^~~~~~~~~
> /home/jdanek/Work/repos/qpid-proton/proton-c/bindings/cpp/include/proton/container.hpp:55:27:
>  error: use of deleted function ‘constexpr 
> proton::internal::pn_unique_ptr<proton::container::impl>::pn_unique_ptr(const 
> proton::internal::pn_unique_ptr<proton::container::impl>&)’
> In file included from 
> /home/jdanek/Work/repos/qpid-proton/proton-c/bindings/cpp/include/proton/connection_options.hpp:29:0,
>                  from 
> /home/jdanek/Work/repos/qpid-proton/proton-c/bindings/cpp/src/container_test.cpp:27:
> /home/jdanek/Work/repos/qpid-proton/proton-c/bindings/cpp/include/proton/./internal/pn_unique_ptr.hpp:43:26:
>  note: ‘constexpr 
> proton::internal::pn_unique_ptr<proton::container::impl>::pn_unique_ptr(const 
> proton::internal::pn_unique_ptr<proton::container::impl>&)’ is implicitly 
> declared as deleted because 
> ‘proton::internal::pn_unique_ptr<proton::container::impl>’ declares a move 
> constructor or move assignment operator
>  template <class T> class pn_unique_ptr {
>                           ^~~~~~~~~~~~~
> make[3]: *** 
> [proton-c/bindings/cpp/CMakeFiles/container_test.dir/build.make:63: 
> proton-c/bindings/cpp/CMakeFiles/container_test.dir/src/container_test.cpp.o] 
> Error 1
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to