How does std::map zero out complex types?


1
2
3
4
5
6
7
8
9
class Complex{
	float a,b,c;
};

void main(){
	map<int,Complex>  Test;

	Complex &Item = Test[0];
}


Item's members are all zeroed out.

I think it is a function call rather than a constructor since map is a red-black tree and likely wraps 'first' and 'second' with pointers to left and right. Several stl types (such as list) contain internal allocators that allocate these internal nodes that keep the lists, trees, etc, coherent. So how does map zero out the members of a complex type if there is no explicit function for this within the type?
Topic archived. No new replies allowed.