Error with Vector of Vectors of Custom struct

closed account (NUj6URfi)
1
2
3
4
5
6
static struct Color //line 31
{
    double x, y, z;
    std::string hex;
};
static std::vector<std::vector<Color>> mtlColors;


Output:
1
2
3
4
5
6
7
8
Linux.h:31:15: note: Color::Color()
 static struct Color
               ^
Linux.h:31:15: note:   candidate expects 0 arguments, 1 provided
Linux.h:31:15: note: Color::Color(const Color&)
Linux.h:31:15: note:   no known conversion for argument 1 from 'std::vector<Color>' to 'const Color&'
Linux.h:31:15: note: Color::Color(Color&&)
Linux.h:31:15: note:   no known conversion for argument 1 from 'std::vector<Color>' to 'Color&&'

I don't know what I'm doing wrong. I'm trying to have a vector of vectors of a custom struct. Thanks in advance!
you cannot declare a struct static without directly creating an instance of it.
remove the static and everything should work

I'm still a little surprised about the error message...

this is the error Message I got:
error: a storage class can only be specified for objects and functions
Last edited on
closed account (NUj6URfi)
I got that too. Scroll down to the bottom for my errors.
you only posted 8 lines of errors...
as I said, try to remove the keyword static
closed account (NUj6URfi)
I did. I got those errors too, I just wasn't worried about them. I still get the errors I said without static.
closed account (NUj6URfi)
I was using it as a single vector, not a vector of vectors. Sorry. Thanks for helping.
Topic archived. No new replies allowed.