#1552 Clarify the return value of the IndexSet::types method
Metadata
Property | Value |
---|---|
Reported by | Oliver Sander (oliver.sander@tu-dresden.de) |
Reported at | Jan 12, 2015 08:18 |
Type | Feature Request |
Version | 2.4 [autotools] |
Operating System | Unspecified / All |
Description
At the 2014 dev meeting we decided that the IndexSet
set class should get a new method types()
, to eventually replace the method geomTypes()
. As usual we have not given a very precise definition of this new method. The full text is
There should be a new method
types()
, that returns an object that is iterable with a forward iterator.
I propose to make this precise by reformulating:
There should be a new method
types() const
, which returns an object of typeTypes
[by value or by reference, see below], whereTypes
is a type exported by the class interface. The exact typeTypes
is implementation defined. However, all implementations ofTypes
are expected to implement the full interface of std::initializer_list. See the C++11 standard or http://www.cplusplus.com/reference/initializer_list/initializer_list/ for details.
- Feel free to debate whether the return value is by-value or by-reference; that's a separate issue
- Note that no special C++11 support is needed. All we do is mimic the
initializer_list
interface - All standard stl containers implement this interface.
I set up a vote at http://users.dune-project.org/doodles/26. If you think the issue is clear enough please vote. Otherwise please voice your concerns here.