0

TestCase.h

class TestCase {
  public:
    template<size_t N> TestCase(int (&arr)[N]) {
      // Constructor code here, I iterate over the array of values.
    }
    // etc
  private:
    int var1;
    // etc
}

This is my header file for a class. The class takes in an array of any size using a template. This works great but I hate having the constructor code in the .h file. How can I move the constructor code into the .cpp file with the rest of the member functions? I can't use vectors or anything. Thanks :)

Alec Fenichel
  • 1,257
  • 1
  • 13
  • 27

0 Answers0