#4771·libzmq

error compiling (static assertion failed)

Author: redeexpressosCreated Feb 20, 2025Updated Jul 22, 2026
                 from /home/repos/Proj/modules/libzmq/src/curve_server.cpp:35:
/usr/include/c++/14/bits/alloc_traits.h: In instantiation of ‘struct std::__allocator_traits_base::__rebind<zmq::secure_allocator_t<unsigned char>, unsigned char, void>’:
/usr/include/c++/14/bits/alloc_traits.h:95:11:   required by substitution of ‘template<class _Alloc, class _Up> using std::__alloc_rebind = typename std::__allocator_traits_base::__rebind<_Alloc, _Up>::type [with _Alloc = zmq::secure_allocator_t<unsigned char>; _Up = unsigned char]’
   95 |     using __alloc_rebind
      |           ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/alloc_traits.h:229:8:   required by substitution of ‘template<class _Alloc> template<class _Tp> using std::allocator_traits< <template-parameter-1-1> >::rebind_alloc = std::__alloc_rebind<_Alloc, _Tp> [with _Tp = unsigned char; _Alloc = zmq::secure_allocator_t<unsigned char>]’
  229 |         using rebind_alloc = __alloc_rebind<_Alloc, _Tp>;
      |               ^~~~~~~~~~~~
/usr/include/c++/14/ext/alloc_traits.h:126:65:   required from ‘struct __gnu_cxx::__alloc_traits<zmq::secure_allocator_t<unsigned char>, unsigned char>::rebind<unsigned char>’
  126 |       { typedef typename _Base_type::template rebind_alloc<_Tp> other; };
      |                                                                 ^~~~~
/usr/include/c++/14/bits/stl_vector.h:87:21:   required from ‘struct std::_Vector_base<unsigned char, zmq::secure_allocator_t<unsigned char> >’
   87 |         rebind<_Tp>::other _Tp_alloc_type;
      |                            ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:428:11:   required from ‘class std::vector<unsigned char, zmq::secure_allocator_t<unsigned char> >’
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/home/repos/Proj/modules/libzmq/src/curve_server.cpp:184:72:   required from here
  184 |     std::vector<uint8_t, secure_allocator_t<uint8_t> > hello_plaintext (
      |                                                                        ^
/usr/include/c++/14/bits/alloc_traits.h:71:31: error: static assertion failed: allocator_traits<A>::rebind_alloc<A::value_type> must be A
   71 |                         _Tp>::value,
      |                               ^~~~~
/usr/include/c++/14/bits/alloc_traits.h:71:31: note: ‘std::integral_constant<bool, false>::value’ evaluates to false
https://github.com/zeromq/libzmq/commit/34f7fa22022bed9e0e390ed3580a1c83ac4a2834

cmake version 3.31.5

gcc (Ubuntu 14.2.0-4ubuntu2) 14.2.0