You are viewing a single comment's thread. Return to all comments →
Once I understood what it was all about I came up with this:
template <bool...digits> int reversed_binary_value() { vector<bool> values{digits...}; int sum = 0; for(int i{0};i < values.size(); ++i) sum += ((1&values[i])<<i); return sum; }
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 →
Once I understood what it was all about I came up with this: