Skip to content

Commit 1a0ee4c

Browse files
authored
Merge pull request #193 from JohanMabille/strides_adaptor
Added missing types in pystrides_adaptor
2 parents 4d0b4ff + ac22477 commit 1a0ee4c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

include/xtensor-python/pyarray.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,14 @@ namespace xt
256256
using array_type = A;
257257
using value_type = typename array_type::size_type;
258258
using const_reference = value_type;
259+
using reference = const_reference;
259260
using const_pointer = const value_type*;
261+
using pointer = const_pointer;
260262
using size_type = typename array_type::size_type;
261263
using difference_type = typename array_type::difference_type;
262264

263265
using const_iterator = pybackstrides_iterator<self_type>;
266+
using iterator = const_iterator;
264267

265268
pyarray_backstrides() = default;
266269
pyarray_backstrides(const array_type& a);

include/xtensor-python/pystrides_adaptor.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,16 @@ namespace xt
2929

3030
using value_type = std::ptrdiff_t;
3131
using const_reference = value_type;
32+
using reference = const_reference;
3233
using const_pointer = const value_type*;
34+
using pointer = const_pointer;
3335
using size_type = std::size_t;
3436
using difference_type = std::ptrdiff_t;
3537

3638
using const_iterator = pystrides_iterator<N>;
39+
using iterator = const_iterator;
3740
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
41+
using reverse_iterator = const_reverse_iterator;
3842

3943
pystrides_adaptor() = default;
4044
pystrides_adaptor(const_pointer data, size_type size);

0 commit comments

Comments
 (0)