Skip to content
Snippets Groups Projects
Commit e88ea5d1 authored by Volker Neff's avatar Volker Neff
Browse files

fix resize problems

parent 5d1aa863
No related branches found
No related tags found
1 merge request!6Draft: [WIP] New Field Architekture
......@@ -87,9 +87,9 @@ public:
// is constructed by FieldFactory.init()
Field() = default;
void resize(size_t count);
void resize(size_t count, double value);
void resizef(size_t count);
void resizef(size_t count, float value);
void resize(size_t count, const T value);
template<typename U>
void resize(size_t count, const U value);
bool empty() const;
void check_gridsize() const;
......@@ -125,7 +125,7 @@ inline void Field<T>::resize(const size_t count)
}
template<typename T>
inline void Field<T>::resize(const size_t count, const double value)
inline void Field<T>::resize(const size_t count, const T value)
{
m_count = count;
varrayResizeInit(vec, m_count, value);
......@@ -134,6 +134,17 @@ inline void Field<T>::resize(const size_t count, const double value)
}
}
template<typename T>
template<typename U>
inline void Field<T>::resize(const size_t count, const U value)
{
m_count = count;
varrayResizeInit(vec, m_count, static_cast<T>(value));
if (!size) {
size = m_count;
}
}
template<typename T>
inline bool Field<T>::empty() const
{
......
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