File tree 1 file changed +5
-0
lines changed
core/include/detray/core/detail
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -156,31 +156,36 @@ class surface_lookup {
156
156
// / Elementwise access. Needs @c operator[] for storage type - non-const
157
157
DETRAY_HOST_DEVICE
158
158
constexpr decltype (auto ) operator[](const std::size_t i) {
159
+ assert (i < m_container.size ());
159
160
return m_container[i];
160
161
}
161
162
162
163
// / Elementwise access. Needs @c operator[] for storage type - const
163
164
DETRAY_HOST_DEVICE
164
165
constexpr decltype (auto ) operator[](const std::size_t i) const {
166
+ assert (i < m_container.size ());
165
167
return m_container[i];
166
168
}
167
169
168
170
// / @returns context based access to an element (also range checked)
169
171
DETRAY_HOST_DEVICE
170
172
constexpr decltype (auto ) at(const dindex i) noexcept {
173
+ assert (i < m_container.size ());
171
174
return m_container.at (i);
172
175
}
173
176
174
177
// / @returns context based access to an element (also range checked) - const
175
178
DETRAY_HOST_DEVICE
176
179
constexpr decltype (auto ) at(const dindex i) const noexcept {
180
+ assert (i < m_container.size ());
177
181
return m_container.at (i);
178
182
}
179
183
180
184
// / @returns the surface descriptor according to the global surface index
181
185
// / @param sf_index
182
186
DETRAY_HOST_DEVICE
183
187
constexpr decltype (auto ) search(dindex sf_index) const {
188
+ assert (sf_index < m_container.size ());
184
189
return m_container[sf_index];
185
190
}
186
191
You can’t perform that action at this time.
0 commit comments