This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This demonstrates that gcc or clang can incur a loss of precision of | |
variables without warning. Compile and run this program to see for yourself. | |
You may need to use `-std=c++11` depending on your compiler. Notice that the | |
size of some of the variables change. If you compile this with `-Wconversion` | |
then the compiler will properly complain about this conversion. | |
`-Wconversion` does not fall under `-Wall` or `-Wextra`. You must also use | |
`-Wconversion` to get the warning message. */ | |
#include <iostream> | |
#include <stdint.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This is a demonstration which uses a struct to store/fetch values from | |
an unordered map. | |
*/ | |
#include <iostream> | |
#include <string> | |
#include <unordered_map> | |
#include <vector> | |
enum container_material { plastic, metal, materialCount }; |