title: Error on implicit cast from std:unique_ptr to bool
body: <p>I am using Allegro to create a simple game. When I try to validate that my pointer to the display is not null I get a compiler error telling me</p>
  
  <blockquote>
    <p>error C2664: 'void validate(bool,std::string)' : cannot convert
    argument 1 from 'std::unique_ptr&lt; ALLEGRO_DISPLAY,main::&lt;
    lambda_996846ce92067e506da99cad36e610cf>>' to 'bool'</p>
  </blockquote>
  
  <p>Here is my code</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;memory&gt;
  #include &lt;string&gt;
  
  #include &lt;allegro5\allegro.h&gt;
  
  using namespace std;
  
  const int WIDTH = 512;
  const int HEIGHT = 512;
  
  void validate(bool ptr, string errorMessage) {
      if (!ptr) {
          cerr &lt;&lt; errorMessage &lt;&lt; endl;
          exit(-1);
      }
  }
  
  int main() {
      auto deleter = [](ALLEGRO_DISPLAY* d) { al_destroy_display(d); };
      unique_ptr&lt;ALLEGRO_DISPLAY, decltype(deleter)&gt; display;
  
      validate(al_init(), "Failed to initialize Allegro");
      display = unique_ptr&lt;ALLEGRO_DISPLAY, decltype(deleter)&gt;(al_create_display(WIDTH, HEIGHT), deleter);
      validate(display, "Failed to create display");
  
      return 0;
  }
  </code></pre>
  
  <p>If I pass validate "!display" instead of "display" it works. I realize I could call validate with display.get(), but I wanted to know why it isn't working when I pass a smart pointer. </p>
  
  <p>I found this bug report. I am using Visual Studio 2013.
  <a href="https://connect.microsoft.com/VisualStudio/feedbackdetail/view/775810/c-11-std-unique-ptr-cast-to-bool-fails-with-deleter-lambda" rel="noreferrer">https://connect.microsoft.com/VisualStudio/feedbackdetail/view/775810/c-11-std-unique-ptr-cast-to-bool-fails-with-deleter-lambda</a></p>