IAP GITLAB

Update Coding authored by Ralf Ulrich's avatar Ralf Ulrich
...@@ -168,7 +168,7 @@ Important rules, and notable differences are summarized here: ...@@ -168,7 +168,7 @@ Important rules, and notable differences are summarized here:
necessary. It should be written in minor letters, suffixed by "_type", like in ``` typedef ClassA someclass_type```. necessary. It should be written in minor letters, suffixed by "_type", like in ``` typedef ClassA someclass_type```.
- Template, meta programming: - Template, meta programming:
- Template (meta) parameters are identified by a prefixed "T", like ```template <typename TProperty>```. This makes it easier in writing code to distinguish classes and types from template (meta) parameters. - Template (meta) parameters are identified by a prefixed "T", like ```template <typename TProperty>```. This makes it easier in writing code to distinguish classes and types from template (meta) parameters.
- All template parameters must be specified using ```concepts/requires``` (see http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rt-concepts). Modern compilers already support it (gcc >= 6.1, clang >= 10). For compilers that do not yet support it, we will comment them out, but have them there as reminder for the programmer about the template requirements. - As a preparation for c++20, all template parameters must be specified using ```concepts/requires``` (see http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rt-concepts). Very modern compilers already support it (gcc >= 6.1, clang >= 10). For now, we will comment these ```concepts``` out, but have them there as reminder for the programmer about the underlying template requirements:
``` ```
template<typename TIter, typename TVal> template<typename TIter, typename TVal>
// requires Input_iterator<TIter> // requires Input_iterator<TIter>
...@@ -178,7 +178,7 @@ Important rules, and notable differences are summarized here: ...@@ -178,7 +178,7 @@ Important rules, and notable differences are summarized here:
// ... // ...
} }
``` ```
Later, as soon as feasible, we will switch to fully use this feature -- also to produce better error messages.
For help how to use this, see [concepts](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/n4569.pdf) or [ranges](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4553.pdf) For help how to use this, see [concepts](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/n4569.pdf) or [ranges](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4553.pdf)
- For class templates, provide deduction guides, if applicable. Also, add instance makers as free functions in the concerning namespace, to deploy type deduction and avoid explicit template instantiation. Look the example below: - For class templates, provide deduction guides, if applicable. Also, add instance makers as free functions in the concerning namespace, to deploy type deduction and avoid explicit template instantiation. Look the example below:
... ...
......