B
Brad Tilley
I'm experimenting with using a struct within a vector located in a
different struct. I'm getting a compiler error. Here are the
structures:
struct shelf_item
{
std::string name;
int weight;
};
struct shelf
{
std::string location;
// compiler error occurs here
std::vector<shelf_item>;
};
The compiler error reads: "a template-id may not appear in a using-
declaration"
Standard types (string, int, etc.) work fine, but my struct doesn't.
There's likely a better way to approach this, but having never tried
it before I wanted to ask here. Not sure it matters, but I'm using g++
4.6.2.
Thanks for any advice.
different struct. I'm getting a compiler error. Here are the
structures:
struct shelf_item
{
std::string name;
int weight;
};
struct shelf
{
std::string location;
// compiler error occurs here
std::vector<shelf_item>;
};
The compiler error reads: "a template-id may not appear in a using-
declaration"
Standard types (string, int, etc.) work fine, but my struct doesn't.
There's likely a better way to approach this, but having never tried
it before I wanted to ask here. Not sure it matters, but I'm using g++
4.6.2.
Thanks for any advice.