[vtkusers] Allowable C++11 Features in VTK

Robert Maynard robert.maynard at kitware.com
Mon Mar 27 16:14:43 EDT 2017


Hi,

Thanks for the feedback.

1. I agree that when doing template metaprogramming, the alias keyword is
significantly better than typedef. I will update the document to state that
we prefer alias over typedef

2. I am going to update the std::array section to clarify that is preferred
over raw fixed size 'C' arrays.

3. This is good information to have. I will add a comment to the scoped
enums section while I wait for more feedback

On Mon, Mar 27, 2017 at 3:30 PM, B B <baljci at hotmail.com> wrote:

> 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-qimQO8N9sE43fHX
> KKlHM2sW2ErohfHiuCg/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
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensou
> rce/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/76510f7b/attachment.html>


More information about the vtkusers mailing list