Checking if a type is a map : <p>I sometimes find the need to write general routines that can be applied to a  container of objects, or a map of such containers (i.e. process each container in the map). One approach is to write separate routines for map types, but I think it can be more natural and less verbose to have one routine that works for both types of input:</p>

<pre><code>template &lt;typename T&gt;
auto foo(const T&amp; items)
{ 
    return foo(items, /* tag dispatch to map or non-map */);
}
</code></pre>

<p>What is a safe, clean way to do this tag dispatch?</p>
