title: compile-time safe array in C++?
body: <p>There's this homework question i've been wrecking my brain about:</p>
  
  <p>I have to create an array class in C++ in which an index access to an element in the array is checked in compile-time, i.e. if I try to access the array with an index outside ita size it will cause a compilation error.</p>
  
  <p>I thought I'd use enums as indexes instead of ints, but I spoke with my instructor and he told me that it's not the correct way, he also said that "think that for the same price you could use this to have an array where the indexes don't start at 0" or something like that.</p>
  
  <p>I'd appreciate any suggestions!</p>