https://wandbox.org/permlink/EjDDKW72cTOKB3et
^^^ cut n paste the span snippet to wandbox with recent gcc gives vvv
4x warning: type qualifiers ignored on function return type on cbegin() and cend()
(and a couple of signed/unsigned comparison warning in the test code)
I managed to quieten the warnings by
- adding a
const_pointer typedef with const added to the type
- updating
const_iterator typedef from const pointer to const_pointer
(or, just update const_iterator but I prefer to also have a const_pointer typedef).
using const_pointer = _Tp const*; // added
using const_iterator = const_pointer; // updated
https://wandbox.org/permlink/EjDDKW72cTOKB3et
^^^ cut n paste the span snippet to wandbox with recent gcc gives vvv
4x
warning: type qualifiers ignored on function return typeoncbegin()andcend()(and a couple of signed/unsigned comparison warning in the test code)
I managed to quieten the warnings by
const_pointertypedef with const added to the typeconst_iteratortypedef fromconst pointertoconst_pointer(or, just update
const_iteratorbut I prefer to also have aconst_pointertypedef).