Polymorphismus in vektoren

mbk_chilli

Grünschnabel
Guten Morgen Community,

ich versuche derzeitig in C++ (GPP) Polymorphismus in einem vector anzuwenden.

Dazu deklariere ich in einer map den vector wie folgt:
Code:
map<int, vector<Zuschlagssatz_Z_Base*> > liste;

Zuschlagssatz_Z_Base ist dabei eine abstrakte Basisklasse.

Danach versuche ich der Map wie folgt einen Antrag hinzuzufügen:
Code:
vector<Zu_Abschlagssatz_Z*> newZuschlagList;
newZuschlagList.push_back(oBase);
liste.insert(std::make_pair(sortierUndAusschlussmerker, newZuschlagList));

oBase = Objekt vom Typ Zu_Abschlagssatz_Z und abgeleitete Klasse von Zuschlagssatz_Z_Base
sortierUndAusschlussmerker = integer value

Leider scheint der Compiler damit einige Probleme zu haben und nennt mir leider keinen für mich verständlichen Fehler. (Bin noch recht frisch in C++)

Die Fehlermeldung die ich beim Kompilieren bekomme ist:
Code:
g++ -I/usr/local/include/pqxx/ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" "../main.cpp"
/usr/include/c++/4.1.3/bits/stl_pair.h: In constructor »std::pair<_T1, _T2>::pair(const std::pair<_U1, _U2>&) [with _U1 = int, _U2 = std::vector<Zu_Abschlagssatz_Z*, std::allocator<Zu_Abschlagssatz_Z*> >, _T1 = const int, _T2 = std::vector<Zuschlagssatz_Z_Base*, std::allocator<Zuschlagssatz_Z_Base*> >]«:
.././src/line_objects/../saetze/header/../base/../header/Artikelsatz_A.h:760:   instantiated from here
/usr/include/c++/4.1.3/bits/stl_pair.h:90: Fehler: keine passende Funktion für Aufruf von »std::vector<Zuschlagssatz_Z_Base*, std::allocator<Zuschlagssatz_Z_Base*> >::vector(const std::vector<Zu_Abschlagssatz_Z*, std::allocator<Zu_Abschlagssatz_Z*> >&)«
/usr/include/c++/4.1.3/bits/stl_vector.h:232: Anmerkung: Kandidaten sind: std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = Zuschlagssatz_Z_Base*, _Alloc = std::allocator<Zuschlagssatz_Z_Base*>]
/usr/include/c++/4.1.3/bits/stl_vector.h:215: Anmerkung:                  std::vector<_Tp, _Alloc>::vector(size_t, const _Tp&, const _Alloc&) [with _Tp = Zuschlagssatz_Z_Base*, _Alloc = std::allocator<Zuschlagssatz_Z_Base*>]
/usr/include/c++/4.1.3/bits/stl_vector.h:202: Anmerkung:                  std::vector<_Tp, _Alloc>::vector(const _Alloc&) [with _Tp = Zuschlagssatz_Z_Base*, _Alloc = std::allocator<Zuschlagssatz_Z_Base*>]
/usr/include/c++/4.1.3/bits/stl_pair.h: In constructor »std::pair<_T1, _T2>::pair(const std::pair<_U1, _U2>&) [with _U1 = int, _U2 = std::vector<Rohstoff_Zu_Abschlagssatz_Z*, std::allocator<Rohstoff_Zu_Abschlagssatz_Z*> >, _T1 = const int, _T2 = std::vector<Zuschlagssatz_Z_Base*, std::allocator<Zuschlagssatz_Z_Base*> >]«:
.././src/line_objects/../saetze/header/../base/../header/Artikelsatz_A.h:778:   instantiated from here
/usr/include/c++/4.1.3/bits/stl_pair.h:90: Fehler: keine passende Funktion für Aufruf von »std::vector<Zuschlagssatz_Z_Base*, std::allocator<Zuschlagssatz_Z_Base*> >::vector(const std::vector<Rohstoff_Zu_Abschlagssatz_Z*, std::allocator<Rohstoff_Zu_Abschlagssatz_Z*> >&)«
/usr/include/c++/4.1.3/bits/stl_vector.h:232: Anmerkung: Kandidaten sind: std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = Zuschlagssatz_Z_Base*, _Alloc = std::allocator<Zuschlagssatz_Z_Base*>]
/usr/include/c++/4.1.3/bits/stl_vector.h:215: Anmerkung:                  std::vector<_Tp, _Alloc>::vector(size_t, const _Tp&, const _Alloc&) [with _Tp = Zuschlagssatz_Z_Base*, _Alloc = std::allocator<Zuschlagssatz_Z_Base*>]
/usr/include/c++/4.1.3/bits/stl_vector.h:202: Anmerkung:                  std::vector<_Tp, _Alloc>::vector(const _Alloc&) [with _Tp = Zuschlagssatz_Z_Base*, _Alloc = std::allocator<Zuschlagssatz_Z_Base*>]
/usr/include/c++/4.1.3/bits/stl_pair.h: In constructor »std::pair<_T1, _T2>::pair(const std::pair<_U1, _U2>&) [with _U1 = int, _U2 = std::vector<Rohstoff_Zuschlagssatz_Z*, std::allocator<Rohstoff_Zuschlagssatz_Z*> >, _T1 = const int, _T2 = std::vector<Zuschlagssatz_Z_Base*, std::allocator<Zuschlagssatz_Z_Base*> >]«:
.././src/line_objects/../saetze/header/../base/../header/Artikelsatz_A.h:796:   instantiated from here
/usr/include/c++/4.1.3/bits/stl_pair.h:90: Fehler: keine passende Funktion für Aufruf von »std::vector<Zuschlagssatz_Z_Base*, std::allocator<Zuschlagssatz_Z_Base*> >::vector(const std::vector<Rohstoff_Zuschlagssatz_Z*, std::allocator<Rohstoff_Zuschlagssatz_Z*> >&)«
/usr/include/c++/4.1.3/bits/stl_vector.h:232: Anmerkung: Kandidaten sind: std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = Zuschlagssatz_Z_Base*, _Alloc = std::allocator<Zuschlagssatz_Z_Base*>]
/usr/include/c++/4.1.3/bits/stl_vector.h:215: Anmerkung:                  std::vector<_Tp, _Alloc>::vector(size_t, const _Tp&, const _Alloc&) [with _Tp = Zuschlagssatz_Z_Base*, _Alloc = std::allocator<Zuschlagssatz_Z_Base*>]
/usr/include/c++/4.1.3/bits/stl_vector.h:202: Anmerkung:                  std::vector<_Tp, _Alloc>::vector(const _Alloc&) [with _Tp = Zuschlagssatz_Z_Base*, _Alloc = std::allocator<Zuschlagssatz_Z_Base*>]

Ich hoffe das mir jemand meinen Fehler nennen kann damit ich diesen dann behebe und lerne wie es quasi richtig in C++. :confused:

greetz
Maurice
 
Zurück