[vtkusers] Allowable C++11 Features in VTK

B B baljci at hotmail.com
Mon Mar 27 15:30:13 EDT 2017


I would suggest the following:


- Prefer the use of alias declarations instead of typedef: they do the same but alias declarations are better because they can be templetized (see Scott Meyers, Effective Modern C++, 63-67)

- Replace raw arrays with std::array when possible: they are copyable, easier to manipulate and have no extra performance costs compared to raw arrays.

- For scoped enums, I would restrict their use to global enums, especially in case of possible name conflicts. For nested enums, I would suggest to maintain the use of unscoped enums for two reasons: first, you don't need to write MyEnum::MyEnumValue each time you use them inside the class implementation; second, from my own experience, their implicit conversion to int can be useful in many cases.

Boris

________________________________
De : vtkusers <vtkusers-bounces at vtk.org> de la part de Robert Maynard <robert.maynard at kitware.com>
Envoyé : lundi 27 mars 2017 20:03
À : VTK Developers; vtk vtk
Objet : [vtkusers] Allowable C++11 Features in VTK

As everyone is aware over the past couple of months we have updated
VTK to require a C++11 compiler, but have not explicitly stated what
C++11 features are usable.

We do not intend to incorporate all features of the language at this
time because of incompatibilities with the structure of VTK and/or
incomplete support for the features by all of the compilers that VTK
aims to support.

The current proposed C++11 features, and where they are allowed can be found at:

https://docs.google.com/document/d/1h7wIq25d-qimQO8N9sE43fHXKKlHM2sW2ErohfHiuCg/edit?usp=sharing

Over the next two weeks please provide feedback, either by commenting
on the google document, or replying on the mailing list. Once the two
weeks are over, we will integrate the result into the existing coding
documentation, and then allow C++11 to be used.
_______________________________________________
Powered by www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
vtkusers Info Page - Kitware<http://public.kitware.com/mailman/listinfo/vtkusers>
public.kitware.com
To see the collection of prior postings to the list, visit the vtkusers Archives. Using vtkusers: To post a message to all the list members, send ...



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170327/943887e8/attachment.html>


More information about the vtkusers mailing list