• + 0 comments
    template <bool...digits>
    int reversed_binary_value(){
        bool arr[] = {digits...};
        int sum = 0;
        int a = 0;
        for(bool i : arr){
            sum = sum | ((1&i) << a++);
        }
        return sum;
    }