tags:

views:

167

answers:

1

I have a declaration like this

#include "Output/PtPathWriter.h"
// class PtPathWriter // I've also tried forward declaring the friend class

// leg data is a class designed to hold data for a single leg.
class PtPathLeg
{
    friend class PtPathWriter; // doesn't work
    //friend void PTPathWriter::writeToFile(string fileName, PtPath* path); // works

protected:
    vector<map<int, shared_ptr<BoardingStopAlternative>>> m_boarding_stop_alternatives; 
    // some other stuff
}

However I get an error from PtPathWriter saying

PtPathWriter.cpp(44): error #308: member "PtPathLeg::m_boarding_stop_alternatives" (declared at line 79 of "../include/Paths/PtPathLeg.h") is inaccessible
1> path->m_leg_data.at(legnr).m_boarding_stop_alternatives.at(stopId);

Interestingly, if I use the alternate friend declaration (which specifies the method explicitly) it does work? Any thoughts on why they are different?

Using Intel C++ Compiler 11.1.065 btw.

A: 

Your little t should be a capital T in P**t**PathWriter.

0A0D