

What features would you like to see added soonest in your favorite C++ compiler? - AndreyKarpov
http://herbsutter.com/2012/10/03/poll-what-features-would-you-like-to-see-added-soonest-in-your-favorite-c-compiler/

======
ambrop7
Static If [1]. Would simplify a lot of template code, like generic data
structures with optional features.

template <class Entry, bool useParents> struct AvlTreeHelper { int balance;
Entry \ _child[2]; static if (useParents) { Entry \_ parent; } };

template <...., bool useParents> void ...::insert (...) { ... static if
(useParents) { // fixup parent pointers } ... }

Such optional behavior can be achieved with existing C++ features by
inheriting specialized template classes, but it makes code very unreadable,
especially when you have big functions with small conditional parts inside, or
when you have more than one boolean condition.

[1] [http://www.open-
std.org/jtc1/sc22/wg21/docs/papers/2012/n332...](http://www.open-
std.org/jtc1/sc22/wg21/docs/papers/2012/n3329.pdf)

------
tbirdz
I'd like to see better template error messages.

~~~
Someone
Have you seen the "template type diffing"
(<http://clang.llvm.org/diagnostics.html>) in clang?

------
J_Darnley
It's not my favourite compiler, I don't even use it, but I would like to see
C99 support added to one.

~~~
sanxiyn
Same here, but we are in the minority.
[http://herbsutter.com/2012/05/03/reader-qa-what-about-vc-
and...](http://herbsutter.com/2012/05/03/reader-qa-what-about-vc-and-c99/)

We do not plan to support ISO C features that are not part of either C90 or
ISO C++. I understand C programmers may be disappointed or angry with this
answer and I'm sorry to have to say no here. It's true, and very quotable,
that "focus means saying no," but that doesn't make it easy to say -- it is
hard to say no to you, and I'm sorry to say it. But we have to choose a focus,
and our focus is to implement and innovate in C++.

