• + 2 comments

    There is simpler way:

    template<bool... digits>
    int reversed_binary_value()
    {
        int result = 0;
        auto list = {digits...};
        
        ....
        return result;
    }
    

    List has std::initializer_list type. Just add iteration (standard iterators, begin() and end()), some binary manipulation and you will get result. It took me 2 lines of code more.