List: Reinstated construction from two iterators and added construction from an initializer list
Until C++ supports 'concepts' the only way to support construction from two iterators is to provide a constructor of the form: template<class InputIterator> List(InputIterator first, InputIterator last); which for some types conflicts with //- Construct with given size and value for all elements List(const label, const T&); e.g. to construct a list of 5 scalars initialized to 0: List<scalar> sl(5, 0); causes a conflict because the initialization type is 'int' rather than 'scalar'. This conflict may be resolved by specifying the type of the initialization value: List<scalar> sl(5, scalar(0)); The new initializer list contructor provides a convenient and efficient alternative to using 'IStringStream' to provide an initial list of values: List<vector> list4(IStringStream("((0 1 2) (3 4 5) (6 7 8))")()); or List<vector> list4 { vector(0, 1, 2), vector(3, 4, 5), vector(6, 7, 8) };
Showing
- applications/test/List/Test-List.C 26 additions, 6 deletionsapplications/test/List/Test-List.C
- src/OpenFOAM/containers/Lists/List/List.C 59 additions, 55 deletionssrc/OpenFOAM/containers/Lists/List/List.C
- src/OpenFOAM/containers/Lists/List/List.H 20 additions, 1 deletionsrc/OpenFOAM/containers/Lists/List/List.H
- src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/chemPointISAT/chemPointISAT.C 1 addition, 1 deletion...mistryModel/tabulation/ISAT/chemPointISAT/chemPointISAT.C