A template parameter pack is a template parameter that accepts zero or more template arguments (non-types, types, or templates). To read more about parameter pack, click here.
Create a template function named reversed_binary_value. It must take an arbitrary number of bool values as template parameters. These booleans represent binary digits in reverse order. Your function must return an integer corresponding to the binary value of the digits represented by the booleans. For example: reversed_binary_value<0,0,1>() should return .
The first line contains an integer, , the number of test cases.
Each of the subsequent lines contains a test case. A test case is described as space-separated integers, and , respectively.
is the value to compare against.
represents the range to compare: to .
The number of template parameters passed to reversed_binary_value will be .
Each line of output contains binary characters (i.e., 's and 's). Each character represents one value in the range. The first character corresponds to the first value in the range. The last character corresponds to the last value in the range. The character is if the value in the range matches ; otherwise, the character is .