On Mon, Jun 03, 2013 at 08:00:58PM +0000, David Holland wrote: > > #define __DECONST(t, a) const_cast<t>(a) > > and I suppose one could also do something like this: > > #define __DECONST(t, v) \ > (sizeof((v) - (const t)0) ? (t)(unsigned long)(v) : 0)
Sounds good to me. I seriously wonder why an intern __-namespaced macro needs to be portable beyound all currently supported architextures. Maybe we could add another clause to the ? selector and check for sizeof(unsigned long) >= sizeof(const t) to make possible future failures very explicit - but that should IMO be enough. On the other hand, the idea of making this *evil* macro usable by C++ code makes me shiver. Plaese don't tell me bind11 or newer gcc will need this! Martin