title: What's the easiest way to get Python's `defaultdict` behavior in C++?
body: <p>In Python, there is a class called <code>defaultdict</code> which is essentially a dictionary that will construct elements on demand according to a function specified by the user at construction time..</p>
  
  <p>Does a similar class already exists in C++, or would I have to create it myself by inheriting from <code>map</code> and overwriting the <code>at</code> method?</p>