Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing <functional> include when building on 22.04 #350

Closed
christophebedard opened this issue Dec 19, 2024 · 4 comments
Closed

Missing <functional> include when building on 22.04 #350

christophebedard opened this issue Dec 19, 2024 · 4 comments

Comments

@christophebedard
Copy link
Member

christophebedard commented Dec 19, 2024

I rebased #294 on rolling yesterday (Dec 18th, potentially after #347), and then rmw_zenoh_cpp started failing to build on my 22.04 system:

Click to expand
Starting >>> rmw_zenoh_cpp
--- stderr: rmw_zenoh_cpp                                      
In file included from /usr/include/c++/11/bits/move.h:57,
                 from /usr/include/c++/11/bits/stl_pair.h:59,
                 from /usr/include/c++/11/utility:70,
                 from /usr/include/c++/11/array:38,
                 from /home/christophe.bedard/ros2_ws/src/rmw_zenoh/rmw_zenoh_cpp/src/detail/attachment_helpers.cpp:15:
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::__is_trivially_copy_constructible_impl<std::reference_wrapper<zenoh::ZShmMut>, true>’:
/usr/include/c++/11/type_traits:1254:12:   required from ‘struct std::is_trivially_copy_constructible<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/type_traits:3200:43:   required from ‘constexpr const bool std::is_trivially_copy_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1249:25: error: invalid use of incomplete type ‘class std::reference_wrapper<zenoh::ZShmMut>’
 1249 |                         __is_trivially_constructible(_Tp, const _Tp&)>>
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:48:11: note: declaration of ‘class std::reference_wrapper<zenoh::ZShmMut>’
   48 |     class reference_wrapper;
      |           ^~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::is_trivially_copy_constructible<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/type_traits:3200:43:   required from ‘constexpr const bool std::is_trivially_copy_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1257:52: error: static assertion failed: template argument must be a complete class or an unbounded array
 1257 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:1257:52: note: ‘std::__is_complete_or_unbounded<std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> > >((std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >{}, std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >()))’ evaluates to false
/usr/include/c++/11/type_traits: In instantiation of ‘constexpr const bool std::is_trivially_copy_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:3200:43: error: ‘value’ is not a member of ‘std::is_trivially_copy_constructible<std::reference_wrapper<zenoh::ZShmMut> >’
 3200 |     is_trivially_copy_constructible<_Tp>::value;
      |                                           ^~~~~
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::__is_trivially_move_constructible_impl<std::reference_wrapper<zenoh::ZShmMut>, true>’:
/usr/include/c++/11/type_traits:1277:12:   required from ‘struct std::is_trivially_move_constructible<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/type_traits:3203:43:   required from ‘constexpr const bool std::is_trivially_move_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1272:25: error: invalid use of incomplete type ‘class std::reference_wrapper<zenoh::ZShmMut>’
 1272 |                         __is_trivially_constructible(_Tp, _Tp&&)>>
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:48:11: note: declaration of ‘class std::reference_wrapper<zenoh::ZShmMut>’
   48 |     class reference_wrapper;
      |           ^~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::is_trivially_move_constructible<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/type_traits:3203:43:   required from ‘constexpr const bool std::is_trivially_move_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1280:52: error: static assertion failed: template argument must be a complete class or an unbounded array
 1280 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:1280:52: note: ‘std::__is_complete_or_unbounded<std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> > >((std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >{}, std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >()))’ evaluates to false
/usr/include/c++/11/type_traits: In instantiation of ‘constexpr const bool std::is_trivially_move_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:3203:43: error: ‘value’ is not a member of ‘std::is_trivially_move_constructible<std::reference_wrapper<zenoh::ZShmMut> >’
 3203 |     is_trivially_move_constructible<_Tp>::value;
      |                                           ^~~~~
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::is_copy_constructible<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/type_traits:3180:33:   required from ‘constexpr const bool std::is_copy_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:666:2:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:987:52: error: static assertion failed: template argument must be a complete class or an unbounded array
  987 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:987:52: note: ‘std::__is_complete_or_unbounded<std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> > >((std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >{}, std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >()))’ evaluates to false
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::is_move_constructible<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/type_traits:3183:33:   required from ‘constexpr const bool std::is_move_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:670:2:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1010:52: error: static assertion failed: template argument must be a complete class or an unbounded array
 1010 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:1010:52: note: ‘std::__is_complete_or_unbounded<std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> > >((std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >{}, std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >()))’ evaluates to false
In file included from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/buffer.hxx:17,
                 from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/bytes.hxx:22,
                 from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api.hxx:16,
                 from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh.hxx:19,
                 from /home/christophe.bedard/ros2_ws/src/rmw_zenoh/rmw_zenoh_cpp/src/detail/attachment_helpers.cpp:22:
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx: In static member function ‘static std::optional<std::reference_wrapper<zenoh::ZShmMut> > zenoh::ZShm::try_mutate(zenoh::ZShm&)’:
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:69:25: error: ‘ref’ is not a member of ‘std’
   69 |             return std::ref(interop::as_owned_cpp_ref<ZShmMut>(shm_mut));
      |                         ^~~
In file included from /usr/include/c++/11/bits/move.h:57,
                 from /usr/include/c++/11/bits/stl_pair.h:59,
                 from /usr/include/c++/11/utility:70,
                 from /usr/include/c++/11/optional:36,
                 from /home/christophe.bedard/ros2_ws/src/rmw_zenoh/rmw_zenoh_cpp/src/detail/zenoh_config.hpp:18,
                 from /home/christophe.bedard/ros2_ws/src/rmw_zenoh/rmw_zenoh_cpp/src/detail/zenoh_config.cpp:15:
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::__is_trivially_copy_constructible_impl<std::reference_wrapper<zenoh::ZShmMut>, true>’:
/usr/include/c++/11/type_traits:1254:12:   required from ‘struct std::is_trivially_copy_constructible<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/type_traits:3200:43:   required from ‘constexpr const bool std::is_trivially_copy_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1249:25: error: invalid use of incomplete type ‘class std::reference_wrapper<zenoh::ZShmMut>’
 1249 |                         __is_trivially_constructible(_Tp, const _Tp&)>>
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:48:11: note: declaration of ‘class std::reference_wrapper<zenoh::ZShmMut>’
   48 |     class reference_wrapper;
      |           ^~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::is_trivially_copy_constructible<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/type_traits:3200:43:   required from ‘constexpr const bool std::is_trivially_copy_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1257:52: error: static assertion failed: template argument must be a complete class or an unbounded array
 1257 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:1257:52: note: ‘std::__is_complete_or_unbounded<std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> > >((std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >{}, std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >()))’ evaluates to false
/usr/include/c++/11/type_traits: In instantiation of ‘constexpr const bool std::is_trivially_copy_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:3200:43: error: ‘value’ is not a member of ‘std::is_trivially_copy_constructible<std::reference_wrapper<zenoh::ZShmMut> >’
 3200 |     is_trivially_copy_constructible<_Tp>::value;
      |                                           ^~~~~
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::__is_trivially_move_constructible_impl<std::reference_wrapper<zenoh::ZShmMut>, true>’:
/usr/include/c++/11/type_traits:1277:12:   required from ‘struct std::is_trivially_move_constructible<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/type_traits:3203:43:   required from ‘constexpr const bool std::is_trivially_move_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1272:25: error: invalid use of incomplete type ‘class std::reference_wrapper<zenoh::ZShmMut>’
 1272 |                         __is_trivially_constructible(_Tp, _Tp&&)>>
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:48:11: note: declaration of ‘class std::reference_wrapper<zenoh::ZShmMut>’
   48 |     class reference_wrapper;
      |           ^~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::is_trivially_move_constructible<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/type_traits:3203:43:   required from ‘constexpr const bool std::is_trivially_move_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1280:52: error: static assertion failed: template argument must be a complete class or an unbounded array
 1280 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:1280:52: note: ‘std::__is_complete_or_unbounded<std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> > >((std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >{}, std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >()))’ evaluates to false
/usr/include/c++/11/type_traits: In instantiation of ‘constexpr const bool std::is_trivially_move_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:3203:43: error: ‘value’ is not a member of ‘std::is_trivially_move_constructible<std::reference_wrapper<zenoh::ZShmMut> >’
 3203 |     is_trivially_move_constructible<_Tp>::value;
      |                                           ^~~~~
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::is_copy_constructible<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/type_traits:3180:33:   required from ‘constexpr const bool std::is_copy_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:666:2:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:987:52: error: static assertion failed: template argument must be a complete class or an unbounded array
  987 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:987:52: note: ‘std::__is_complete_or_unbounded<std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> > >((std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >{}, std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >()))’ evaluates to false
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::is_move_constructible<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/type_traits:3183:33:   required from ‘constexpr const bool std::is_move_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:670:2:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1010:52: error: static assertion failed: template argument must be a complete class or an unbounded array
 1010 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:1010:52: note: ‘std::__is_complete_or_unbounded<std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> > >((std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >{}, std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >()))’ evaluates to false
In file included from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/buffer.hxx:17,
                 from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/bytes.hxx:22,
                 from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api.hxx:16,
                 from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh.hxx:19,
                 from /home/christophe.bedard/ros2_ws/src/rmw_zenoh/rmw_zenoh_cpp/src/detail/zenoh_config.hpp:22,
                 from /home/christophe.bedard/ros2_ws/src/rmw_zenoh/rmw_zenoh_cpp/src/detail/zenoh_config.cpp:15:
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx: In static member function ‘static std::optional<std::reference_wrapper<zenoh::ZShmMut> > zenoh::ZShm::try_mutate(zenoh::ZShm&)’:
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:69:25: error: ‘ref’ is not a member of ‘std’
   69 |             return std::ref(interop::as_owned_cpp_ref<ZShmMut>(shm_mut));
      |                         ^~~
In file included from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/detail/closures.hxx:16,
                 from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/bytes.hxx:16,
                 from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api.hxx:16,
                 from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh.hxx:19,
                 from /home/christophe.bedard/ros2_ws/src/rmw_zenoh/rmw_zenoh_cpp/src/detail/zenoh_utils.hpp:18,
                 from /home/christophe.bedard/ros2_ws/src/rmw_zenoh/rmw_zenoh_cpp/src/detail/zenoh_utils.cpp:15:
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::__is_trivially_copy_constructible_impl<std::reference_wrapper<zenoh::ZShmMut>, true>’:
/usr/include/c++/11/type_traits:1254:12:   required from ‘struct std::is_trivially_copy_constructible<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/type_traits:3200:43:   required from ‘constexpr const bool std::is_trivially_copy_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1249:25: error: invalid use of incomplete type ‘class std::reference_wrapper<zenoh::ZShmMut>’
 1249 |                         __is_trivially_constructible(_Tp, const _Tp&)>>
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:48:11: note: declaration of ‘class std::reference_wrapper<zenoh::ZShmMut>’
   48 |     class reference_wrapper;
      |           ^~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::is_trivially_copy_constructible<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/type_traits:3200:43:   required from ‘constexpr const bool std::is_trivially_copy_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1257:52: error: static assertion failed: template argument must be a complete class or an unbounded array
 1257 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:1257:52: note: ‘std::__is_complete_or_unbounded<std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> > >((std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >{}, std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >()))’ evaluates to false
/usr/include/c++/11/type_traits: In instantiation of ‘constexpr const bool std::is_trivially_copy_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:3200:43: error: ‘value’ is not a member of ‘std::is_trivially_copy_constructible<std::reference_wrapper<zenoh::ZShmMut> >’
 3200 |     is_trivially_copy_constructible<_Tp>::value;
      |                                           ^~~~~
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::__is_trivially_move_constructible_impl<std::reference_wrapper<zenoh::ZShmMut>, true>’:
/usr/include/c++/11/type_traits:1277:12:   required from ‘struct std::is_trivially_move_constructible<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/type_traits:3203:43:   required from ‘constexpr const bool std::is_trivially_move_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1272:25: error: invalid use of incomplete type ‘class std::reference_wrapper<zenoh::ZShmMut>’
 1272 |                         __is_trivially_constructible(_Tp, _Tp&&)>>
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:48:11: note: declaration of ‘class std::reference_wrapper<zenoh::ZShmMut>’
   48 |     class reference_wrapper;
      |           ^~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::is_trivially_move_constructible<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/type_traits:3203:43:   required from ‘constexpr const bool std::is_trivially_move_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1280:52: error: static assertion failed: template argument must be a complete class or an unbounded array
 1280 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:1280:52: note: ‘std::__is_complete_or_unbounded<std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> > >((std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >{}, std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >()))’ evaluates to false
/usr/include/c++/11/type_traits: In instantiation of ‘constexpr const bool std::is_trivially_move_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:3203:43: error: ‘value’ is not a member of ‘std::is_trivially_move_constructible<std::reference_wrapper<zenoh::ZShmMut> >’
 3203 |     is_trivially_move_constructible<_Tp>::value;
      |                                           ^~~~~
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::is_copy_constructible<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/type_traits:3180:33:   required from ‘constexpr const bool std::is_copy_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:666:2:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:987:52: error: static assertion failed: template argument must be a complete class or an unbounded array
  987 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:987:52: note: ‘std::__is_complete_or_unbounded<std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> > >((std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >{}, std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >()))’ evaluates to false
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::is_move_constructible<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/type_traits:3183:33:   required from ‘constexpr const bool std::is_move_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:670:2:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1010:52: error: static assertion failed: template argument must be a complete class or an unbounded array
 1010 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:1010:52: note: ‘std::__is_complete_or_unbounded<std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> > >((std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >{}, std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >()))’ evaluates to false
In file included from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/buffer.hxx:17,
                 from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/bytes.hxx:22,
                 from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api.hxx:16,
                 from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh.hxx:19,
                 from /home/christophe.bedard/ros2_ws/src/rmw_zenoh/rmw_zenoh_cpp/src/detail/zenoh_utils.hpp:18,
                 from /home/christophe.bedard/ros2_ws/src/rmw_zenoh/rmw_zenoh_cpp/src/detail/zenoh_utils.cpp:15:
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx: In static member function ‘static std::optional<std::reference_wrapper<zenoh::ZShmMut> > zenoh::ZShm::try_mutate(zenoh::ZShm&)’:
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:69:25: error: ‘ref’ is not a member of ‘std’
   69 |             return std::ref(interop::as_owned_cpp_ref<ZShmMut>(shm_mut));
      |                         ^~~
In file included from /usr/include/c++/11/bits/move.h:57,
                 from /usr/include/c++/11/bits/stl_pair.h:59,
                 from /usr/include/c++/11/utility:70,
                 from /usr/include/c++/11/optional:36,
                 from /home/christophe.bedard/ros2_ws/src/rmw_zenoh/rmw_zenoh_cpp/src/detail/zenoh_config.hpp:18,
                 from /home/christophe.bedard/ros2_ws/src/rmw_zenoh/rmw_zenoh_cpp/src/detail/zenoh_config.cpp:15:
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::__is_trivially_copy_constructible_impl<std::reference_wrapper<zenoh::ZShmMut>, true>’:
/usr/include/c++/11/type_traits:1254:12:   required from ‘struct std::is_trivially_copy_constructible<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/type_traits:3200:43:   required from ‘constexpr const bool std::is_trivially_copy_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1249:25: error: invalid use of incomplete type ‘class std::reference_wrapper<zenoh::ZShmMut>’
 1249 |                         __is_trivially_constructible(_Tp, const _Tp&)>>
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:48:11: note: declaration of ‘class std::reference_wrapper<zenoh::ZShmMut>’
   48 |     class reference_wrapper;
      |           ^~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::is_trivially_copy_constructible<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/type_traits:3200:43:   required from ‘constexpr const bool std::is_trivially_copy_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1257:52: error: static assertion failed: template argument must be a complete class or an unbounded array
 1257 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:1257:52: note: ‘std::__is_complete_or_unbounded<std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> > >((std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >{}, std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >()))’ evaluates to false
/usr/include/c++/11/type_traits: In instantiation of ‘constexpr const bool std::is_trivially_copy_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:3200:43: error: ‘value’ is not a member of ‘std::is_trivially_copy_constructible<std::reference_wrapper<zenoh::ZShmMut> >’
 3200 |     is_trivially_copy_constructible<_Tp>::value;
      |                                           ^~~~~
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::__is_trivially_move_constructible_impl<std::reference_wrapper<zenoh::ZShmMut>, true>’:
/usr/include/c++/11/type_traits:1277:12:   required from ‘struct std::is_trivially_move_constructible<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/type_traits:3203:43:   required from ‘constexpr const bool std::is_trivially_move_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1272:25: error: invalid use of incomplete type ‘class std::reference_wrapper<zenoh::ZShmMut>’
 1272 |                         __is_trivially_constructible(_Tp, _Tp&&)>>
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:48:11: note: declaration of ‘class std::reference_wrapper<zenoh::ZShmMut>’
   48 |     class reference_wrapper;
      |           ^~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::is_trivially_move_constructible<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/type_traits:3203:43:   required from ‘constexpr const bool std::is_trivially_move_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1280:52: error: static assertion failed: template argument must be a complete class or an unbounded array
 1280 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:1280:52: note: ‘std::__is_complete_or_unbounded<std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> > >((std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >{}, std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >()))’ evaluates to false
/usr/include/c++/11/type_traits: In instantiation of ‘constexpr const bool std::is_trivially_move_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:3203:43: error: ‘value’ is not a member of ‘std::is_trivially_move_constructible<std::reference_wrapper<zenoh::ZShmMut> >’
 3203 |     is_trivially_move_constructible<_Tp>::value;
      |                                           ^~~~~
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::is_copy_constructible<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/type_traits:3180:33:   required from ‘constexpr const bool std::is_copy_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:666:2:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:987:52: error: static assertion failed: template argument must be a complete class or an unbounded array
  987 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:987:52: note: ‘std::__is_complete_or_unbounded<std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> > >((std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >{}, std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >()))’ evaluates to false
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::is_move_constructible<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/type_traits:3183:33:   required from ‘constexpr const bool std::is_move_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:670:2:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1010:52: error: static assertion failed: template argument must be a complete class or an unbounded array
 1010 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:1010:52: note: ‘std::__is_complete_or_unbounded<std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> > >((std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >{}, std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >()))’ evaluates to false
In file included from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/buffer.hxx:17,
                 from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/bytes.hxx:22,
                 from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api.hxx:16,
                 from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh.hxx:19,
                 from /home/christophe.bedard/ros2_ws/src/rmw_zenoh/rmw_zenoh_cpp/src/detail/zenoh_config.hpp:22,
                 from /home/christophe.bedard/ros2_ws/src/rmw_zenoh/rmw_zenoh_cpp/src/detail/zenoh_config.cpp:15:
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx: In static member function ‘static std::optional<std::reference_wrapper<zenoh::ZShmMut> > zenoh::ZShm::try_mutate(zenoh::ZShm&)’:
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:69:25: error: ‘ref’ is not a member of ‘std’
   69 |             return std::ref(interop::as_owned_cpp_ref<ZShmMut>(shm_mut));
      |                         ^~~
gmake[2]: *** [CMakeFiles/rmw_zenohd.dir/build.make:132: CMakeFiles/rmw_zenohd.dir/src/detail/zenoh_config.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[2]: *** [CMakeFiles/rmw_zenoh_cpp.dir/build.make:76: CMakeFiles/rmw_zenoh_cpp.dir/src/detail/attachment_helpers.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[2]: *** [CMakeFiles/rmw_zenoh_cpp.dir/build.make:370: CMakeFiles/rmw_zenoh_cpp.dir/src/detail/zenoh_utils.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:165: CMakeFiles/rmw_zenohd.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake[2]: *** [CMakeFiles/rmw_zenoh_cpp.dir/build.make:356: CMakeFiles/rmw_zenoh_cpp.dir/src/detail/zenoh_config.cpp.o] Error 1
In file included from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/detail/closures.hxx:16,
                 from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/bytes.hxx:16,
                 from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api.hxx:16,
                 from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh.hxx:19,
                 from /home/christophe.bedard/ros2_ws/src/rmw_zenoh/rmw_zenoh_cpp/src/rmw_init_options.cpp:15:
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::__is_trivially_copy_constructible_impl<std::reference_wrapper<zenoh::ZShmMut>, true>’:
/usr/include/c++/11/type_traits:1254:12:   required from ‘struct std::is_trivially_copy_constructible<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/type_traits:3200:43:   required from ‘constexpr const bool std::is_trivially_copy_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1249:25: error: invalid use of incomplete type ‘class std::reference_wrapper<zenoh::ZShmMut>’
 1249 |                         __is_trivially_constructible(_Tp, const _Tp&)>>
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:48:11: note: declaration of ‘class std::reference_wrapper<zenoh::ZShmMut>’
   48 |     class reference_wrapper;
      |           ^~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::is_trivially_copy_constructible<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/type_traits:3200:43:   required from ‘constexpr const bool std::is_trivially_copy_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1257:52: error: static assertion failed: template argument must be a complete class or an unbounded array
 1257 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:1257:52: note: ‘std::__is_complete_or_unbounded<std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> > >((std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >{}, std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >()))’ evaluates to false
/usr/include/c++/11/type_traits: In instantiation of ‘constexpr const bool std::is_trivially_copy_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:3200:43: error: ‘value’ is not a member of ‘std::is_trivially_copy_constructible<std::reference_wrapper<zenoh::ZShmMut> >’
 3200 |     is_trivially_copy_constructible<_Tp>::value;
      |                                           ^~~~~
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::__is_trivially_move_constructible_impl<std::reference_wrapper<zenoh::ZShmMut>, true>’:
/usr/include/c++/11/type_traits:1277:12:   required from ‘struct std::is_trivially_move_constructible<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/type_traits:3203:43:   required from ‘constexpr const bool std::is_trivially_move_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1272:25: error: invalid use of incomplete type ‘class std::reference_wrapper<zenoh::ZShmMut>’
 1272 |                         __is_trivially_constructible(_Tp, _Tp&&)>>
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:48:11: note: declaration of ‘class std::reference_wrapper<zenoh::ZShmMut>’
   48 |     class reference_wrapper;
      |           ^~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::is_trivially_move_constructible<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/type_traits:3203:43:   required from ‘constexpr const bool std::is_trivially_move_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1280:52: error: static assertion failed: template argument must be a complete class or an unbounded array
 1280 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:1280:52: note: ‘std::__is_complete_or_unbounded<std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> > >((std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >{}, std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >()))’ evaluates to false
/usr/include/c++/11/type_traits: In instantiation of ‘constexpr const bool std::is_trivially_move_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/optional:662:11:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:3203:43: error: ‘value’ is not a member of ‘std::is_trivially_move_constructible<std::reference_wrapper<zenoh::ZShmMut> >’
 3203 |     is_trivially_move_constructible<_Tp>::value;
      |                                           ^~~~~
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::is_copy_constructible<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/type_traits:3180:33:   required from ‘constexpr const bool std::is_copy_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:666:2:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:987:52: error: static assertion failed: template argument must be a complete class or an unbounded array
  987 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:987:52: note: ‘std::__is_complete_or_unbounded<std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> > >((std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >{}, std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >()))’ evaluates to false
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::is_move_constructible<std::reference_wrapper<zenoh::ZShmMut> >’:
/usr/include/c++/11/type_traits:3183:33:   required from ‘constexpr const bool std::is_move_constructible_v<std::reference_wrapper<zenoh::ZShmMut> >’
/usr/include/c++/11/optional:670:2:   required from ‘class std::optional<std::reference_wrapper<zenoh::ZShmMut> >’
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:67:83:   required from here
/usr/include/c++/11/type_traits:1010:52: error: static assertion failed: template argument must be a complete class or an unbounded array
 1010 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:1010:52: note: ‘std::__is_complete_or_unbounded<std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> > >((std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >{}, std::__type_identity<std::reference_wrapper<zenoh::ZShmMut> >()))’ evaluates to false
In file included from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/buffer.hxx:17,
                 from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/bytes.hxx:22,
                 from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api.hxx:16,
                 from /home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh.hxx:19,
                 from /home/christophe.bedard/ros2_ws/src/rmw_zenoh/rmw_zenoh_cpp/src/rmw_init_options.cpp:15:
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx: In static member function ‘static std::optional<std::reference_wrapper<zenoh::ZShmMut> > zenoh::ZShm::try_mutate(zenoh::ZShm&)’:
/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:69:25: error: ‘ref’ is not a member of ‘std’
   69 |             return std::ref(interop::as_owned_cpp_ref<ZShmMut>(shm_mut));
      |                         ^~~
gmake[2]: *** [CMakeFiles/rmw_zenoh_cpp.dir/build.make:468: CMakeFiles/rmw_zenoh_cpp.dir/src/rmw_init_options.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:139: CMakeFiles/rmw_zenoh_cpp.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< rmw_zenoh_cpp [3.74s, exited with code 2]

Note this error message, which is repeated a few times:

/home/christophe.bedard/ros2_ws/install/zenoh_cpp_vendor/opt/zenoh_cpp_vendor/include/zenoh/api/shm/buffer/zshm.hxx:69:25: error: ‘ref’ is not a member of ‘std’

It seems like something in zenoh uses std::ref without including <functional>. Including <functional> in some locations before <zenoh.hxx> is included fixes the build:

diff --git a/rmw_zenoh_cpp/src/detail/attachment_helpers.cpp b/rmw_zenoh_cpp/src/detail/attachment_helpers.cpp
index 6f128b4..9e72f20 100644
--- a/rmw_zenoh_cpp/src/detail/attachment_helpers.cpp
+++ b/rmw_zenoh_cpp/src/detail/attachment_helpers.cpp
@@ -13,6 +13,7 @@
 // limitations under the License.
 
 #include <array>
+#include <functional>
 #include <cstdlib>
 #include <cstring>
 #include <stdexcept>
diff --git a/rmw_zenoh_cpp/src/detail/zenoh_config.hpp b/rmw_zenoh_cpp/src/detail/zenoh_config.hpp
index 1f1e194..cc8bc79 100644
--- a/rmw_zenoh_cpp/src/detail/zenoh_config.hpp
+++ b/rmw_zenoh_cpp/src/detail/zenoh_config.hpp
@@ -15,6 +15,7 @@
 #ifndef DETAIL__ZENOH_CONFIG_HPP_
 #define DETAIL__ZENOH_CONFIG_HPP_
 
+#include <functional>
 #include <optional>
 #include <unordered_map>
 #include <utility>
diff --git a/rmw_zenoh_cpp/src/detail/zenoh_utils.hpp b/rmw_zenoh_cpp/src/detail/zenoh_utils.hpp
index a88b132..657b4e4 100644
--- a/rmw_zenoh_cpp/src/detail/zenoh_utils.hpp
+++ b/rmw_zenoh_cpp/src/detail/zenoh_utils.hpp
@@ -15,6 +15,8 @@
 #ifndef DETAIL__ZENOH_UTILS_HPP_
 #define DETAIL__ZENOH_UTILS_HPP_
 
+#include <functional>
+
 #include <zenoh.hxx>
 
 #include <array>
diff --git a/rmw_zenoh_cpp/src/rmw_init_options.cpp b/rmw_zenoh_cpp/src/rmw_init_options.cpp
index 15e06e2..760f904 100644
--- a/rmw_zenoh_cpp/src/rmw_init_options.cpp
+++ b/rmw_zenoh_cpp/src/rmw_init_options.cpp
@@ -12,6 +12,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include <functional>
+
 #include <zenoh.hxx>
 
 #include "detail/identifier.hpp"

Note that <zenoh.hxx> is sometimes included before the STL includes. For example, see zenoh_utils.hpp. In any case, this should probably instead be fixed in zenoh.

@ahcorde ahcorde mentioned this issue Dec 19, 2024
@clalancette
Copy link
Collaborator

Interestingly, we didn't see this because it doesn't fail on Ubuntu 24.04 for whatever reason. Regardless, as I wrote in #351 (comment) , we should fix this in upstream zenoh-cpp.

@ahcorde
Copy link
Contributor

ahcorde commented Dec 19, 2024

Related PR eclipse-zenoh/zenoh-cpp#342 in zenoh_cpp

@YuanYuYuan
Copy link
Contributor

Thanks, @ahcorde and @christophebedard! The PR looks good to me. By the way, I did a test within Iron and Humble dockers (22.04). It surprised me that it passed in Humble but failed in Iron.

@clalancette
Copy link
Collaborator

This was fixed by #353, so closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants