title: Trouble with unique_ptr : not a member of 'std'
body: <p>I have a hard time finding why compiler tell me this:</p>
  
  <pre><code>main.cpp:51:17: error: ‘unique_ptr’ in namespace ‘std’ does not name a template type
   static std::unique_ptr&lt;Pizza&gt; createPizza(PizzaType t_pizza)
  </code></pre>
  
  <p>and this:</p>
  
  <pre><code>main.cpp:69:5: error: ‘unique_ptr’ is not a member of ‘std’
   std::unique_ptr&lt;Pizza&gt; pizza = PizzaFactory::createPizza(t_pizzaType);
  </code></pre>
  
  <p>I have the include for unique_ptr</p>
  
  <pre><code>#include &lt;memory&gt;
  </code></pre>
  
  <p>and I use the good C++ compilation flags</p>
  
  <pre><code>CFLAGS  =   -std=c++11 -W -Wall -Wextra -Werror -pedantic
  </code></pre>
  
  <p>I have already try <strong>using namespace std</strong>;</p>
  
  <p>Here are the block of code where I use <strong>std::unique_ptr</strong></p>
  
  <pre><code>class PizzaFactory
  {
   public:
    enum PizzaType
    {
    Hawaiian,
    Vegetarian,
    Carnivoro
    };
  
    static std::unique_ptr&lt;Pizza&gt; createPizza(PizzaType t_pizza)
    {
    switch (t_pizza)
    {
    case Hawaiian:
      return std::unique_ptr&lt;HawaiianPizza&gt;(new HawaiianPizza());
    case Vegetarian:
      return std::unique_ptr&lt;VegetarianPizza&gt;(new VegetarianPizza());
    case Carnivoro:
      return std::unique_ptr&lt;CarnivoroPizza&gt;(new CarnivoroPizza());
    default:
      throw "Invalid pizza type.";
    }
    }
  };
  
  void pizza_information(PizzaFactory::PizzaType t_pizzaType)
  {
    std::unique_ptr&lt;Pizza&gt; pizza = PizzaFactory::createPizza(t_pizzaType);
    std::cout &lt;&lt; "Price of " &lt;&lt; t_pizzaType &lt;&lt; "is " &lt;&lt; pizza-&gt;getPrice() &lt;&lt; '\n';
  }
  </code></pre>
  
  <p>I really can find what's wrong with this code, please help</p>
  
  <p>Thank you.</p>
  
  <p><strong>edit.</strong></p>
  
  <p>Here is the Makefile I use:</p>
  
  <pre><code>NAME    =   plazza
  
  G++ =   g++
  
  CFLAGS  =   -W -Wall -Wextra -Werror -std=c++11
  
  SRC =   main.cpp
  
  OBJ =   $(SRC:.cpp=.o)
  
  RM  =   rm -rf
  
  all:    $(NAME)
  
  $(NAME):    $(OBJ)
      $(G++) $(CFLAGS) $(OBJ) -o $(NAME)
  
  clean:
      $(RM) $(OBj)
  
  fclean: clean
      $(RM) $(NAME)
  
  re: fclean  all
  </code></pre>
  
  <p><strong>edit2.</strong></p>
  
  <p>Here a smal code that give me the same errors:</p>
  
  <pre><code>#include &lt;memory&gt;
  #include &lt;iostream&gt;
  
  class Hi
  {
      public:
          void sayHi(const std::string &amp;t_hi)
          {
              std::cout &lt;&lt; t_hi &lt;&lt; '\n';
          }
  };
  
  int main()
  {
      auto hi = std::unique_ptr&lt;Hi&gt;(new Hi());
  
      hi-&gt;sayHi("Salut");
      return 0;
  }
  </code></pre>
  
  <p>compile with the Makefile above you should have the error</p>