• + 0 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;
    }