fork download
  1. #include <iostream>
  2. #include <cstdint>
  3. using namespace std;
  4.  
  5. template <typename t, uint8_t number_of_bits> struct bin_size {};
  6.  
  7. template <uint8_t number_of_bits>
  8. struct bin_size<uint8_t, number_of_bits> {
  9. const uint8_t upper_bound = 255;
  10. };
  11.  
  12. template <uint8_t number_of_bits>
  13. struct bin_size<int32_t, number_of_bits> {
  14. const uint8_t upper_bound = 60 * number_of_bits * 10;
  15. };
  16.  
  17. int main() {
  18. bin_size<int32_t, 17> s;
  19. return 0;
  20. }
Success #stdin #stdout 0s 3136KB
stdin
Standard input is empty
stdout
Standard output is empty