-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.cpp
45 lines (30 loc) · 1.22 KB
/
test.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <iostream>
#include <map>
#include "./include/HContainer.hpp"
#include <typeindex>
int main()
{
//std::type_info tinfo(typeid(double));
std::type_index tinfo(typeid(double));
std::pair<int, int> mypair{1, 1};
//std::pair<std::type_info, void*>{typeid(double), nullptr};
std::pair<std::type_index, HContainerBase*> thepair{typeid(int), new HContainer<int>};
delete thepair.second;
HContainer<double> container;
container.Set(2.0);
std::cout << container.Get() << std::endl;
// std::map<const std::string, HContainerBase> map;
// map["configoption1"] =
//HContainerPair hcontainerpair(std::unique_ptr<int>(new int));
//HContainerPair hcontainerpair(std::unique_ptr<int>(new int));
HContainerPair hcontainerpair(new int);
//std::map<std::string, HContainerPair*> themap;
//themap.insert("string0", HContainerPair(new double)); // writing HContainerPair here is annoying!
//themap.insert("string0", &hcontainerpair);
HContainerMap hcontainermap;
hcontainermap.Insert("string1", new double);
hcontainermap.Insert("string2", new int);
*hcontainermap["string1"] = 50.0;
std::cout << hcontainermap["string1"] << std::endl;
return 0;
}