Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

unordered_map jako szablon

4 views
Skip to first unread message

RM

unread,
Aug 28, 2020, 3:31:25 AM8/28/20
to
Uczę się C++.
Nie rozumiem dlaczego mam błąd w poniższej definicji typu:

typedef std::unordered_map<std::string /* found string in apostrophes
*/, std::string /* key in $GLOBALS */> strings_map;

Oto ten błąd:

src/common.hpp:70:14: error: ‘unordered_map’ in namespace ‘std’ does not
name a template type
typedef std::unordered_map<std::string /* found string in apostrophes
*/, std::string /* key in $GLOBALS */> strings_map;

Przecież klasa std::unordered_map to szablon.

RM

unread,
Aug 28, 2020, 4:01:47 AM8/28/20
to
Tzn. próbowałem opcji -std=c++11 albo -std=c++0x i nie pomogło, nadal błąd.

heby

unread,
Aug 28, 2020, 4:33:15 AM8/28/20
to
On 28/08/2020 09:31, RM wrote:
> src/common.hpp:70:14: error: ‘unordered_map’ in namespace ‘std’ does not
> name a template type

#include <unordered_map> masz?

RM

unread,
Aug 28, 2020, 5:49:28 AM8/28/20
to
W dniu 28.08.2020 o 10:33, heby pisze:
Dodałem typedef później i zapomniałem dopisać include. Dzięki!
0 new messages