This gem is from the wikibook
More C++ Idioms, to get the address without needing a valid operator&. Enjoy the cast once, cast twice, wait, I didn't mean char at all goodness.
template
T * addressof(T & v)
{
return reinterpret_cast(& const_cast(reinterpret_cast(v)));
}
1 comment:
Uggghhh.
Post a Comment