I want to create a structure that allocates statically an array of 2^N bytes, but I don\'t want the users of this structure to specify this size as the exponent
You can use static_assert to provide an error message:
static_assert
template struct is_power_of_two { static_assert((N > 1) & !(N & (N - 1)), "Template parameter must be a power of two."); };