Как вернуть элементы из вектора с заданным типом C++?
i have a class EscapeRoomWrapper now i made another two classes which are the "sons" of this class ScaryRoom and KidsRoom , which means ScaryRoom is a EscapeRoomWrapper and KidsRoom is a EscapeRoomWrapper , now for each one of those classes i wrote functions .. i am working now from another class which is company , and in this class i added a set of all the rooms (EscapeRoomWrapper,ScaryRoom,KidsRoom) now i want to write a function in class company that i give it a type of room and it should returns for me all of the rooms from that type that exists in the victor of all rooms , then i thougt about using typeid but then the professer banned us from using it , my last idea is to use cast dynamic <pre>any ideas of how i can do this function ?? <pre>std::vector<EscapeRoomWrapper*>& getAllRoomsByType(RoomType type) const.
Что я уже пробовал:
общественный:
// функции здесь
};
частный:
int a
общественный:
// функций на г номер
};
класс: публичный {