C ++ renewable functions (exit) in visual studio 2015 RC access violation

I am trying to use the sample code for renewable features in Visual Studio 2015 RC from this MSDN link .

#include<iostream>
#include<experimental/generator>

auto hello()
{
   for (auto ch : "Hello, world\n")
      yield ch;
}

int main()
{
   for (auto ch : hello())
      std::cout << ch;
}

      

So far, regardless of my compiler options, the code throws an access violation exception when run.

Here are my compiler flags:

/ Yu "stdafx.h" / GS - / W3 / Zc: wchar_t / ZI / Gm / Od / sdl- / Fd "x64 \ Debug \ vc140.pdb" / Zc: inline / fp: exact / D "WIN32" / D "_DEBUG" / D "_CONSOLE" / D "_UNICODE" / D "UNICODE" / errorReport: prompt / WX- / Zc: forScope / Gd / MDd / Fa "x64 \ Debug \" / EHsc / nologo / Fo "x64 \ Debug \ "/ Fp" x64 \ Debug \ Test.pch "

Does anyone figure out how to get it to work?

+3


source to share


1 answer


I got a response from a comment on the original MSDN link . The problem is in the flag /ZI

(database of the program to edit and continue) which is not supported yet. Transition to /ZI

work.



+3


source







All Articles