This prevents creating instances of LoanedMessage when using a custom allocator which is not based on std::allocator. Our recommendation to resolve this issue is to modify the constructor to use MessageAllocator as the type for the allocator parameter:
@thomasmoore-torc as always, thanks for sending us a patch and good description 👍 i created https://github.com/ros2/rclcpp/pull/2672, if you can review, that would be really appreciated.
Bug report
Required Info:
Steps to reproduce issue
The
LoanedMessage
class is defined with anAllocatorT
template parameter which is used as the type for themessage_allocator_
member variable:However, the constructor accepts an
allocator
parameter which is of typestd::allocator<MessageT>
:This prevents creating instances of
LoanedMessage
when using a custom allocator which is not based onstd::allocator
. Our recommendation to resolve this issue is to modify the constructor to useMessageAllocator
as the type for theallocator
parameter: