[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Adding size_type and value_type members to Array<T>
From: |
Carnë Draug |
Subject: |
Adding size_type and value_type members to Array<T> |
Date: |
Fri, 12 Aug 2016 00:52:01 +0100 |
I'm thinking of adding size_type and value_type as member types to
Array for better compatibility with STL. Like so:
typedef T value_type;
typedef octave_idx_type size_type;
The reason for this is twofold: 1) someone more used to STL will be
able to use them, 2) makes it easier to write templates that accept
STL and Array.
I don't think there will be any issue with value_type, the only question
is if we should deprecate element_type.
size_type is trickier because STL concepts that have size_type mention
that it is an unsigned integer which octave_idx_type is not. Also, it
is kind of odd to call it size_type when there's no size method. The
closest to size() in Octave is numel() which returns an octave_idx_type.
These seems like a small issue compared to not having size_type at all.
Carnë
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Adding size_type and value_type members to Array<T>,
Carnë Draug <=