You are viewing a single comment's thread. Return to all comments →
template <bool...digits> int reversed_binary_value() { int num = 0; int power = 0; for(bool digit : {digits...}){ num += digit ? pow(2, power) : 0; power += 1; } return num; }
Seems like cookies are disabled on this browser, please enable them to open this website
C++ Variadics
You are viewing a single comment's thread. Return to all comments →