I'm writing a program for my class which involves using a class inside of a struct. When defining the struct (named polynomial) 'Polynomial does not name a type'. It triggers on the first line of the default constructor:
Polynomial::Polynomial(){
coefs = vector<Fraction>();
}
Specifically the error occurs on the "Polynomial::Polynomial(){" line.
All other examples I've found for this error include using class B
inside class A before class B is declared. The only member of Polynomial is a vector of class Fractions. I have tried forward declaration of class Fractions and vector is included. This is probably a rookie mistake as I am still very new to C++ classes (this being my first one) so any help would be appreciated.
The relevant portion of the polynomial header file is:
// data members
vector<Fraction> coefs;
// methods
Polynomial() = default;