I get a \"transfer of control bypasses initialization of:\" error when i try to build the following switch:
switch (retrycancel)
{
case 4: //The user
a switch is essentially a goto, that is, it is a goto to the appropriate label. The C++ standard forbids a goto to bypass an initialization of a non-POD object. Take the vector declaration into braces and it will solve the problem
switch (retrycancel)
{
case 4: //The user pressed RETRY
{
std::vector windows = MainHandles().enum_windows().get_results(); //Enumerate all visible windows and store handle and caption in "windows"
break;
}
case 2:
//code
}