
13 Nov
2006
13 Nov
'06
3:47 p.m.
"Michael Marcin"
Thank you. It works and makes sense now because of your explanations. I've been working for a year now using C++ almost exclusively and there is still so much left to learn *sigh*.
You're welcome. James Dennett reminded me off-list that there's a
trick for doing power-of-2 detection: (n>0 and (n&(n-1))==0)
// something like this
template <class N>
struct is_power_of_2
: mpl::and<
mpl::greater