std::experimental::generator write access violation
<p>I am running this code on Visual Studio 2015 Update 1 and I am getting really weird access violation error at the place denoted below. If I simplify the expression to something like <code>int mid = (max - min) / 2;</code> the code works fine.</p>

<pre><code>#include &lt;experimental/generator&gt;

std::experimental::generator&lt;int&gt; range(int min, int max)
{
    int mid = min + (max - min) / 2;  // write access violation
    yield mid;
}

int main()
{
    for (auto x : range(10, 20)) { }
}
</code></pre>

<p>Does anyone know what might be the problem? I am suspecting that it might be a compiler bug.</p>