#include <iostream>

enum class BoardType : uint8_t { 
  Classic = 0,
  Static = 1,
  Smart = 2,
  Bad = 255  
};

BoardType Cast[UINT8_MAX];     // <- сюда просто забить константы -++
                                                                   //
inline BoardType ToEnum(const uint8_t i) {                         //
  BoardType Ret = Cast[i];                                         //
  if (Ret == BoardType::Bad) throw std::range_error("Беда");       //
  return Ret;                                                      //
}                                                                  //
                                                                   //
int main () {                                                      //
  ////// вместо  инициализации ниже - ///////////////////////////////  
  for(auto i=0; i<UINT8_MAX; i++) Cast[i] = BoardType::Bad;
  Cast[0] = BoardType::Classic;
  Cast[1] = BoardType::Static;
  Cast[2] = BoardType::Smart; 
  //////////////////////////////////////////////////////////////////  
  try {  
    std::cout << static_cast<int>(ToEnum(0)) << std::endl;  
    std::cout << static_cast<int>(ToEnum(1)) << std::endl;
    std::cout << static_cast<int>(ToEnum(2)) << std::endl;
    std::cout << static_cast<int>(ToEnum(3)) << std::endl;  
  } catch(std::range_error &e) {
    std::cout << "range_error: " << e.what() << std::endl;  
  } catch(...) {
    std::cout << "что-то совсем пошло не так" << std::endl;  
  }    
  return 0;        
}
