Skip to content
Snippets Groups Projects
Commit ed514577 authored by David Gutiérrez Menéndez's avatar David Gutiérrez Menéndez Committed by Sergey Gorbunov
Browse files

Fix missing header in CaConfigReader. #3470

parent 42abd8c9
No related branches found
No related tags found
1 merge request!1963Fix missing header in CaConfigReader. #3470
Pipeline #31785 passed
......@@ -11,6 +11,7 @@
#include "CaIteration.h"
#include <functional>
#include <string>
#include <unordered_map>
#include <vector>
......
......@@ -133,6 +133,7 @@ namespace cbm::algo::ca
template<typename... Tinput>
void enlarge(std::size_t count, Tinput... value)
{
#ifndef FAST_CODE
if (count < Tbase::size()) {
LOG(fatal) << "ca::Vector \"" << fName << "\"::enlarge(" << count
<< "): the new size is smaller than the current one " << Tbase::size() << ", something goes wrong.";
......@@ -143,6 +144,7 @@ namespace cbm::algo::ca
<< Tbase::capacity() << " is reached, the vector of size " << Tbase::size()
<< " will be copied to the new place.";
}
#endif
Tbase::resize(count, value...);
}
......@@ -150,11 +152,13 @@ namespace cbm::algo::ca
/// \param count Size of the new vector
void reduce(std::size_t count)
{
#ifndef FAST_CODE
if (count > Tbase::size()) {
LOG(fatal) << "ca::Vector \"" << fName << "\"::reduce(" << count
<< "): the new size is bigger than the current one " << Tbase::size() << ", something goes wrong.";
assert(count < Tbase::size());
}
#endif
Tbase::resize(count);
}
......@@ -162,11 +166,13 @@ namespace cbm::algo::ca
/// \param count New size of the vector
void reserve(std::size_t count)
{
#ifndef FAST_CODE
if (!Tbase::empty()) {
LOG(fatal) << "ca::Vector \"" << fName << "\"::reserve(" << count << "): the vector is not empty; "
<< " it will be copied to the new place.";
assert(Tbase::empty());
}
#endif
Tbase::reserve(count);
}
......
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