tartg / uebungen_prgt_1718 Goto Github PK
View Code? Open in Web Editor NEWMusterlösungen für die Übungen "Programmieren technischer Anwendungen" im WS17/18 an der Hochschule Rosenheim
License: GNU General Public License v3.0
Musterlösungen für die Übungen "Programmieren technischer Anwendungen" im WS17/18 an der Hochschule Rosenheim
License: GNU General Public License v3.0
Hello,
I'm having the problem to properly compile the code and receive the following error:
error: no match for call to '(const std::hash) (const EventType&)'
build with TDM-GCC-64 (x86_64-w64-mingw32) also tried with the normal mingw32 but still that error.
Made a minimalistic example of it:
#include <iostream>
#include <unordered_map>
enum class test{
A,B,C,D,E,F
};
int main() {
std::cout << "!!!Hello World!!!" << std::endl;
std::unordered_map<test,int, std::hash<int> > m;
m[test::A] = 12;
std::cout << "m[test::A]:" << m[test::A] << std::endl;
return 0;
}
and it still produces that error. I suspect that is has to do with the strong type of the enum class which does not have an implicit conversion to int. But unordered_map needs int for the hash function. unordered_map just knows about int and not about test or EventType (in this case).
also see:
https://stackoverflow.com/questions/8357240/how-to-automatically-convert-strongly-typed-enum-into-int
https://stackoverflow.com/questions/18837857/cant-use-enum-class-as-unordered-map-key
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.