This code
#include <iostream>
#include <map>
int main()
{
std::map<int, std::size_t> m;
m[0] = m.size();
std::cout << m[0] << std::endl;
}
will print 0 with vc++ and 1 with g++.
- Is this code valid?
- If yes, which compiler is correct?
- Intuitively I would expect
1. How does vc++ end up with0?