can a struct member be a reference to another class? I have this struct in header file:
struct stop_object {
timetable& tt;
std::string stop_name;
std::set<std::string> platforms;
};
and this class in header file:
using stop_container = std::vector<stop_object>;
class timetable {
public:
stop_container timetable_stops;
platform_container timetable_platforms;
platform_route_container timetable_platform_routes;
route_departure_container timetable_route_departures;
trip_container timetable_trips;
trip_departure_container timetable_trip_departures;
};
I can not build the program. It says: missing type specifier. for timetable& tt; How can I achieve that I will have the reference to the parent object in which the struct is? Thanks for help!