double horizon_value::test(brain<horizon_value>& B) {
neuron<horizon_value>* N_back = B.N->back(); // error here, on "B"
the "brain" type is declared like this:
1 2 3 4
template <typename TTrainer>
struct brain {
// bunch of stuff
TTrainer* pT; // points to an instance of "horizon_value"
I suspect it's because I've made a mess of things by having a function inside horizon_value that takes as input something which is templated to horizon_value. Is there a way around this without fundamentally altering the methodology? Note that if I pass "B" by a pointer I get the same error, except it says that an incomplete pointer type is not allowed...
Ah right I got it; the problem was that while I did forward-declare brain<TTrainer>, I didn't define it until after I had defined horizon_value (which included the function that calls brain<horizon_value>). Thanks for the help :)