Files
openfoam/applications/test
Henry Weller d01eb45cfc 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)
    };
2016-08-02 09:31:41 +01:00
..
2014-12-11 08:35:10 +00:00
2014-12-11 08:35:10 +00:00
2016-02-08 16:18:07 +00:00
2016-04-16 18:34:41 +01:00
2016-04-16 18:34:41 +01:00
2015-02-04 16:33:02 +00:00
2014-12-11 08:35:10 +00:00
2013-09-27 22:47:59 +01:00