Boost logo

Boost :

Subject: Re: [boost] [local_function] how bad is this `static_cast<>`?
From: John Bytheway (jbytheway+boost_at_[hidden])
Date: 2010-09-12 05:54:54


On 11/09/10 19:52, Lorenzo Caminiti wrote:
> I almost wish Boosters could conclude they will not want/accept the
> hack and they are willing to use `this_` so to make
> Boost.LocalFunction implementation easier :) .
>
> *** Please advice -- or ask questions if you need more information in
> order to advice. ***

I think requiring this_ is fine. I was a bit worried about the
possibility of silent failure when people forget (quite likely to happen
during refactoring) but luckily there are very few circumstances I can
thing of where it wouldn't give a compile error when you accidentally
use this (the two that spring to mind are printing out the value, and
reinterpret_casting it). Still, if there were a way to make it
impossible to use 'this' at all, that would be nice to avoid this risk
(but I doubt you can).

John Bytheway


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