12
12
namespace boost {
13
13
namespace histogram {
14
14
15
-
16
15
template <class T , class BASE >
17
16
struct multi_weight_base : public BASE {
18
17
using BASE::BASE;
@@ -29,31 +28,30 @@ struct multi_weight_base : public BASE {
29
28
bool operator !=(const S values) const {
30
29
return !operator ==(values);
31
30
}
32
-
33
-
34
31
};
35
32
36
33
template <class T >
37
34
struct multi_weight_reference : public multi_weight_base <T, boost::span<T>> {
38
- // using boost::span<T>::span;
35
+ // using boost::span<T>::span;
39
36
using multi_weight_base<T, boost::span<T>>::multi_weight_base;
40
37
41
38
void operator ()(const boost::span<T> values) { operator +=(values); }
42
39
43
- // template <class S>
44
- // bool operator==(const S values) const {
45
- // if(values.size() != this->size())
46
- // return false;
47
- //
40
+ // template <class S>
41
+ // bool operator==(const S values) const {
42
+ // if(values.size() != this->size())
43
+ // return false;
44
+ //
48
45
// return std::equal(this->begin(), this->end(), values.begin());
49
46
// }
50
- //
51
- // template <class S>
52
- // bool operator!=(const S values) const {
47
+ //
48
+ // template <class S>
49
+ // bool operator!=(const S values) const {
53
50
// return !operator==(values);
54
51
// }
55
52
56
- // void operator+=(const std::vector<T> values) { operator+=(boost::span<T>(values)); }
53
+ // void operator+=(const std::vector<T> values) {
54
+ // operator+=(boost::span<T>(values)); }
57
55
58
56
void operator +=(const boost::span<T> values) {
59
57
// template <class S>
@@ -81,31 +79,32 @@ struct multi_weight_value : public multi_weight_base<T, std::vector<T>> {
81
79
82
80
multi_weight_value (const boost::span<T> values) {
83
81
this ->assign (values.begin (), values.end ());
84
- }
82
+ }
85
83
multi_weight_value () = default ;
86
84
87
85
void operator ()(const boost::span<T> values) { operator +=(values); }
88
86
89
- // template <class S>
90
- // bool operator==(const S values) const {
91
- // if(values.size() != this->size())
92
- // return false;
93
- //
87
+ // template <class S>
88
+ // bool operator==(const S values) const {
89
+ // if(values.size() != this->size())
90
+ // return false;
91
+ //
94
92
// return std::equal(this->begin(), this->end(), values.begin());
95
93
// }
96
- //
97
- // template <class S>
98
- // bool operator!=(const S values) const {
94
+ //
95
+ // template <class S>
96
+ // bool operator!=(const S values) const {
99
97
// return !operator==(values);
100
98
// }
101
- //
102
- // void operator+=(const std::vector<T> values) { operator+=(boost::span<T>(values)); }
103
-
104
- // template <class S>
105
- // void operator+=(const S values) {
99
+ //
100
+ // void operator+=(const std::vector<T> values) {
101
+ // operator+=(boost::span<T>(values)); }
102
+
103
+ // template <class S>
104
+ // void operator+=(const S values) {
106
105
void operator +=(const boost::span<T> values) {
107
106
if (values.size () != this ->size ()) {
108
- if (this ->size () > 0 ) {
107
+ if (this ->size () > 0 ) {
109
108
throw std::runtime_error (" size does not match" );
110
109
}
111
110
this ->assign (values.begin (), values.end ());
0 commit comments