News for hackers. Stuff that matters.
Re:Writing Good C++14 by Default [pdf] by fauigerzigerk on Wednesday September 23, 2015 @06:11AM (#10264192)
>What I would like to see in C++ is to have very detailed control over language features and enforce coding guidelines in my own code base.

Maybe something similar to JavaScript's "use strict" would be good, including the ability to restrict it to function/class/source file scope.

Re:Writing Good C++14 by Default [pdf] by jzwinck on Wednesday September 23, 2015 @08:30AM (#10264590)
We already have that: `gcc -Wall -Wextra`, and a few more flags for specific things that some projects find too restrictive.
Re:Writing Good C++14 by Default [pdf] by fauigerzigerk on Wednesday September 23, 2015 @08:59AM (#10264715)
Assuming "that" means "very detailed control over language features" I would say no, these flags don't provide that.

Only very few flags warn or disable the use of entire language features. Most are warnings against dangerous ways of using some of the features.

Re:Writing Good C++14 by Default [pdf] by toth on Wednesday September 23, 2015 @10:45AM (#10265294)
I believe gp meant Javascript's "use strict" equivalent in C++, which I would say is comparable to the compiler flags.
Re:Writing Good C++14 by Default [pdf] by fauigerzigerk on Wednesday September 23, 2015 @11:02AM (#10265431)
"use strict" isn't comparable to warning flags at all, because it changes the behavior of code. I only brought it up because it can be applied selectively within function scope, not specifically for what it does.

I think what we need is a way to selectively disable language features. Changing the behavior of existing features is a much more questionable thing to do in my view.

The big question is if it's possible to disable some features without affecting how other features must work. It failed miserably for exceptions, but exceptions are a cross cutting sort of concern.