mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Throwing error for incorrect vector size in RGBColor constructor.
This commit is contained in:
parent
6de340e39a
commit
bcc26f96ab
1 changed files with 3 additions and 1 deletions
|
|
@ -38,7 +38,9 @@ struct RGBColor {
|
|||
RGBColor(int r, int g, int b) : red(r), green(g), blue(b) { };
|
||||
|
||||
RGBColor(const std::vector<int> &v) {
|
||||
assert(v.size() == 3);
|
||||
if (v.size() != 3) {
|
||||
throw std::out_of_range("Incorrect vector size for RGBColor.");
|
||||
}
|
||||
red = v[0];
|
||||
green = v[1];
|
||||
blue = v[2];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue