Boost logo

Boost :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2025-05-06 21:34:10


AMDG

On 4/30/25 4:15 PM, Jean-Louis Leroy via Boost wrote:
> Hi Joaquín,
>
> * Instead of BOOST_OPENMETHOD(poke, (std::ostream&,virtual_ptr<Animal>), void),
> consider the possibility of using BOOST_OPENMETHOD(poke, void(std::ostream&,
> virtual_ptr<Animal>)).
>
> I tried since you last suggested this. Couldn't make it work. The macro
> generates something like:
>
> auto poke(std::ostream& a, virtual_ptr<Animal> b) -> void {
> method<poke_method(std::ostream& a, virtual_ptr<Animal> b)>::fn(a, b);
> }
>
> There is no way to peel off the `void` from the signature with the syntax you
> suggest.
>

It doesn't need to be peeled off by the macro. You're only using it
as a template parameter, so you can just pass the whole signature
as a function type.

In Christ,
Steven Watanabe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk