No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
<p>I have a strange error I don't really understand, with VS2013.
It's just a simplification of my real problem resulting in the same error.</p>

<pre><code>std::function&lt;bool()&gt; x = (someCondition == true)
    ? []() { return true; }
    : []() { return false; };
</code></pre>

<p>VS Compiler error is:</p>

<pre><code>1&gt;f:\test\cppconsoleapplication\cppconsoleapplication.cpp(497): error C2446: ':' : no conversion from 'main::&lt;lambda_96d01fe3721e46e4e8217a69a07d151b&gt;' to 'main::&lt;lambda_0d38919a9b2aba5caf910d83eac11776&gt;'
1&gt;          No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
</code></pre>

<p>IntelliSense even came up with this mysterious error message:</p>

<pre><code>IntelliSense: more than one operator "?" matches these operands:
        built-in operator "expression ? pointer : pointer"
        built-in operator "expression ? pointer : pointer"
        built-in operator "expression ? pointer : pointer"
        built-in operator "expression ? pointer : pointer"
        operand types are: lambda []bool ()-&gt;bool : lambda []bool ()-&gt;bool  f:\Test\CppConsoleApplication\CppConsoleApplication.cpp 496
</code></pre>

<p>whereas the following compiles</p>

<pre><code>std::function&lt;bool()&gt; x = []() { return true; };

if (someCondition == false)
    x = []() { return false; };
</code></pre>

<p>Is it just one of VisualStudio's bugs or what am I doing wrong here?</p>