Constructor missing while writing class to use in std::map (c++)

I meant to implement a two dimensional hash map using std::map with c++ STL.
First of all, a data class was defined.

``````class DInfo {
public:
int i, j, k;
DInfo(int _i, int _j, int _k) { i=_i; j=_j; k=_k; }
};```
```

Simple, enough. Now, it's time to define a two dimensional hashmap.

``````typedef std::map DMAP;
std::map diMap;```
```

No problem is observed till here. Let's write some codes to use them.
There're some RogueWave stuff starting with "RW" for DB interface but just ignore that part.

``````RWDBTable tbl=database.table("MyTable");
RWDBSelector sel=database.selector();
sel << tbl["Field1"] << tbl["Field2"] << tbl["Field3"];
while (rdr()) {
int i, j;
rdr >> i >> j;
DMAP dmap=diMap[i];
DInfo di(i, j, k);
dmap[j]=di;
diMap[i]=dmap;
}```
```

Everything looks fine. Let's compile it using gcc. Ooops!

``````testSDDI.cpp:48: error: no matching function for call to `DInfo::DInfo()'
DInfo.h:4: note: candidates are: DInfo::DInfo(const DInfo&)
DInfo.h:13: note: DInfo::DInfo(int, int, int)```
```

Huh!!!??? What happens here?
I spent couple of hours to find out the problem of my code and found, finally.
It's missing default constructor of the class DInfo. Let's add the default constructor.

``````class DInfo {
public:
int i, j, k;
DInfo(int _i, int _j, int _k) { i=_i; j=_j; k=_k; }
DInfo() { i=j=k=0; };
};```
```

In the following line above

``````...
dmap[j]=di;
...```
```

The default constructor of DInfo is called to instantiate an object for the element of dmap[j] seemlessly
and it calls copy constructor to copy(overwrite) it the contents of di.
Thus we still need default constructor although no actual code calls it.

Now, it's compiled smoothly. Yahoo!

Remember, we'd better implement a default constructor for a class while we're using some library
without knowing the detail of it.
{"ft_lang_label":"__label__en","ft_lang_prob":0.73601896,"math_prob":0.6298079,"size":2360,"snap":"2020-34-2020-40","text_gpt3_token_len":644,"char_repetition_ratio":0.11375212,"word_repetition_ratio":0.08152174,"special_character_ratio":0.27711865,"punctuation_ratio":0.23507462,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9864956,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-08-05T22:31:51Z\",\"WARC-Record-ID\":\"<urn:uuid:beb4d7b3-821d-4a07-88f5-b08ddb850ea7>\",\"Content-Length\":\"46102\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:8ed41897-e1ec-4b95-a7ba-05c4d6ef6883>\",\"WARC-Concurrent-To\":\"<urn:uuid:2512241d-27bb-4970-94ec-a03b03bb5b79>\",\"WARC-IP-Address\":\"107.20.139.176\",\"WARC-Target-URI\":\"http://classicalprogrammer.wikidot.com/constructor-missing-std-map/comments/show\",\"WARC-Payload-Digest\":\"sha1:YZCOO3WDTOZTJU5W722XGOIIDZHVP63O\",\"WARC-Block-Digest\":\"sha1:U3HK6SNKZPM5HQLH6XIQGAGJTNLKMH7S\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-34/CC-MAIN-2020-34_segments_1596439735989.10_warc_CC-MAIN-20200805212258-20200806002258-00186.warc.gz\"}"}