std::unique_ptr instantiate error trying to place inside std::map?
<p>So I'm using SFML and Boost libraries trying to write a ResourceManager class. I'm using a std::map to contain the resources. I recently have heard that std::unique_ptr is really good because it of memory cleanup (or something along those lines).</p>

<p>This is what my ResourceManager class looks like:</p>

<pre><code>#pragma once

#include &lt;boost/Any.hpp&gt;
#include &lt;map&gt;
#include &lt;memory&gt;
#include &lt;SFML/Graphics.hpp&gt;

#include "Resource.h"


class ResourceManager
{
    public:
        ResourceManager();
        void clear();
        void dump();
        boost::any getResource(std::string s);
        sf::Texture loadTexture(std::string s, sf::IntRect d);
        void unloadTexture(std::string s);

    private:
        std::map&lt;std::string, std::unique_ptr&lt;boost::any&gt;&gt; resource;
};
</code></pre>

<p>Here is the method I'm trying to use to load objects into my map</p>

<pre><code>sf::Texture ResourceManager::loadTexture(std::string s, sf::IntRect d)
{
    std::unique_ptr&lt;sf::Texture&gt; t;

    if (!t-&gt;loadFromFile(s, d))
        std::cout &lt;&lt; "Error loading resource: " &lt;&lt; s &lt;&lt; std::endl;

    resource[s] = t;
}
</code></pre>

<p>However I get this error here at this line: <a href="https://i.stack.imgur.com/PRIpY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PRIpY.png" alt="http://i.imgur.com/0uDZvvw.png"></a></p>