Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-1629

[cpp] proton::container is not move constructible

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Not A Bug
    • proton-c-0.18.0
    • None
    • cpp-binding
    • None

    Description

      Following C++11 code does not compile

          auto handler = proton::messaging_handler();
          auto container = proton::container(handler); // container is not move constructible
      

      Error from GCC is

      /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
      

      Attachments

        Activity

          People

            astitcher Andrew Stitcher
            jdanek Jiri Daněk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: