C++11 get std::map value_type from a variable
<p>Is there a way to get the <a href="https://msdn.microsoft.com/en-us/library/y6ec19ye.aspx" rel="noreferrer">value_type</a> from a variable of type <code>std::map&lt;K,V&gt;</code></p>

<p>For example:</p>

<pre><code>class Foo{
    private:
        std::map&lt;int,double&gt; myMap;
    public:
        void Bar(const std::map&lt;int,double&gt;&amp; m)
        {
            using PairType = m::value_type; //How to enable something like this?
            std::vector&lt;PairType&gt; vec(m.size());
            read_ints_and_doubles(&amp;vec, m.size()); //expects a void* (legacy lib I'm using)
        }
};
</code></pre>

<p>Obviously I know I can use <code>std::map&lt;int,double&gt;::value_type</code>, but I want this to be open for future changes.</p>

<p>I thought about using <code>using MyMapType = std::map&lt;int,double&gt;</code> and then simply use <code>MyMapType</code> everywhere, but I don't want to do that and it seems to me that there is a way to to get this information from the variable itself since this is all static information and I don't see why I can't access this info.</p>

<p><strong>EDIT:</strong>
This question is far different than the suggested dup: <a href="https://stackoverflow.com/questions/2888130/declare-variables-that-depend-on-unknown-type-in-template-functions">Declare variables that depend on unknown type in template functions</a> since I don't try to declare any variable, and the type is known.</p>