c++ - Allow for variable to be used in local scope -


i'm looking @ large legacy project variables declared in for statements used outside scope. vs2013 doesn't , give compiler errors.

how can tell vstudio allow that?

for (cbookmarks::iterator = m_listbookmarks.begin();     !(it==m_listbookmarks.end()) && hselected!=it->hparent;     it++);  cstring hierarchy = lookuphierarchy(it->hparent); 

it's large project not maintain. i'm reading source code , trying run reference new project. not want "fix" code base.

edit

for reason still compile errors despite configuring:

enter image description here

i tried changing https://msdn.microsoft.com/en-us/library/84wcsx8x.aspx?f=255&mspperror=-2147217396 still compilation errors.

use:

/zc:forscope- 

as documented: https://msdn.microsoft.com/en-us/library/84wcsx8x.aspx

but hate idea of using such switch. suggest using following change have same effect:

cbookmarks::iterator = m_listbookmarks.begin(); (;     !(it==m_listbookmarks.end()) && hselected!=it->hparent;     it++);  cstring hierarchy = lookuphierarchy(it->hparent); 

important need remove pre compiled header cachefile (*.pch) after activate setting, has no effect otherwise.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -