mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Some refactoring and const correctness fixes.
This commit is contained in:
parent
70bc392003
commit
81187e7e0e
3 changed files with 21 additions and 21 deletions
|
@ -289,13 +289,13 @@ public:
|
|||
throw std::runtime_error("ConfigOptionVector::set_at(): Assigning an incompatible type");
|
||||
}
|
||||
|
||||
T& get_at(size_t i)
|
||||
const T& get_at(size_t i) const
|
||||
{
|
||||
assert(! this->values.empty());
|
||||
return (i < this->values.size()) ? this->values[i] : this->values.front();
|
||||
}
|
||||
|
||||
const T& get_at(size_t i) const { return const_cast<ConfigOptionVector<T>*>(this)->get_at(i); }
|
||||
T& get_at(size_t i) { return const_cast<T&>(std::as_const(*this).get_at(i)); }
|
||||
|
||||
// Resize this vector by duplicating the /*last*/first value.
|
||||
// If the current vector is empty, the default value is used instead.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue