Skip to content
Snippets Groups Projects
Commit fc86b2a9 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

use Vec::indexOfPtr

parent a1c1f783
No related branches found
No related tags found
1 merge request!2381rm class and source pair ProjectionsSet
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#define BORNAGAIN_BASE_TYPES_OWNINGVECTOR_H #define BORNAGAIN_BASE_TYPES_OWNINGVECTOR_H
#include "Base/Util/Assert.h" #include "Base/Util/Assert.h"
#include "Base/Util/Vec.h"
#include <algorithm> #include <algorithm>
#include <cstddef> #include <cstddef>
#include <utility> #include <utility>
...@@ -59,13 +60,7 @@ public: ...@@ -59,13 +60,7 @@ public:
T* const& at(int i) const { return m_v.at(i); } T* const& at(int i) const { return m_v.at(i); }
T* const& front() const { return m_v.front(); } T* const& front() const { return m_v.front(); }
T* const& back() const { return m_v.back(); } T* const& back() const { return m_v.back(); }
int index_of(const T* t) const int index_of(const T* t) const { return Vec::indexOfPtr(t, m_v); }
{
for (size_t i = 0; i < m_v.size(); i++)
if (m_v[i] == t)
return int(i);
return -1;
}
void delete_element(T* e) void delete_element(T* e)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment