I have a structure of the following type

struct Node
    {
        int  word;       
        int   count;       
        unordered_map<Type, Node*> map;       

    }node;   

Is it safe to assume that sizeof(node) gives you the correct size of that node in C++? I am sure there will be padding in the structure but still will the sizeof take into consideration the correct size of the unordered_map.

没有正确的解决方案

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top