My colleague likes to write code to initialize fields of struct using memset like this:

```
struct Fun {
    int mem;
    int cpu;
    std::map<int, int> cpumap;
    std::string str;

    Fun() {
       int size = (char*)&(this->cpumap) - (char*)this;
       memset(this, 0, size);
    }
};

```

He says this code is 100% correct and can do the job well. So is this the typical way of initializing a struct in C++? I mean the behavior of this kind of code is defined well?