[OT] initialisation in C++
Ola Fosheim Grøstad via Digitalmars-d
digitalmars-d at puremagic.com
Mon Jun 12 12:32:01 PDT 2017
On Monday, 12 June 2017 at 18:08:46 UTC, Ali Çehreli wrote:
> All the help is valuable but C++ code can be impossible to
> understand (in reasonable time) for IDEs as well.
Probably, but when you write code with a set of tools you adapt
patterns so the tools and what you do with the tools match up. So
taking over a convoluted code base is different from writing a
new program.
But there clearly are certain areas of generic programming with
constructors and initializers that can be surprisingly
challenging in C++. If you want mix templated constructors that
take lists of literals and many other types then you have to be
careful to get the correct constructors to match up properly with
the actual arguments provided. The rules of resolution are
difficult to remember, which is rather counter productive.
In C++ I have found that giving up some generic ambitions and
making generic types simpler is the best way to stay productive.
Probably true for any language, but especially true for C++ I
think.
More information about the Digitalmars-d
mailing list