File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 24
24
#include " TMatrixTSym.h"
25
25
#include " TMatrixTSparse.h"
26
26
27
+ #include < ROOT/RSpan.hxx>
28
+
27
29
template <class Element > class TVectorT : public TObject {
28
30
29
31
protected:
@@ -82,6 +84,20 @@ template<class Element> class TVectorT : public TObject {
82
84
inline Element *data () { return fElements ; }
83
85
inline const Element *data () const { return fElements ; }
84
86
87
+ // Implicit conversion of TVectorT to std::span, both non-const and const
88
+ // version. Can be removed once the minimum C++ standard in C++20, because
89
+ // then it's enough to implement the contiguous_range and sized_range
90
+ // concepts. This should alredy be the case since data() and size() are
91
+ // available.
92
+ inline operator std::span<Element>()
93
+ {
94
+ return std::span<Element>{data (), size ()};
95
+ }
96
+ inline operator std::span<const Element>() const
97
+ {
98
+ return std::span<const Element>{data (), size ()};
99
+ }
100
+
85
101
inline void Invalidate () { SetBit (kStatus ); }
86
102
inline void MakeValid () { ResetBit (kStatus ); }
87
103
inline Bool_t IsValid () const { return !TestBit (kStatus ); }
You can’t perform that action at this time.
0 commit comments