You are viewing a single comment's thread. Return to all comments →
template <bool... digits> int reversed_binary_value(){ std::vector<int> parameterPack = {digits...}; //std::reverse(parameterPack.begin(), parameterPack.end()); int a = 0; int sum = 0; for (bool i : parameterPack) { sum = sum + std::pow(2,a)*i; a++; } 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 →