Q1 : Something took my attention there. Guy uses template specifically for int, and not for a generic type. I couldnt find an example usage like that on internet.
Q2 : template<int i,int Size> in function parameters guy did not passed 'i', but used it inside function definition.
Q3 : If that function is working how can i use that function? Like
BitPositionToMask(); ??? where do i add 'i' integer as an argument.
My questions could be silly, and sorry if it is. I just got confused by this.