
I tried typedef string Colour; struct edge_properties { vector < set< Colour
& > eColours;
} But it did not compile. Shouldn't it ? Thanks -JR

typedef string Colour;
struct edge_properties {
vector < set< Colour > & > eColours;
}
No, it won't compile. Template arguments of a vector are required to be default constructible. Reference types (set<color>&) are not default constructible. See: set<color>& x; // Error. Andrew Sutton andrew.n.sutton@gmail.com

AMDG Andrew Sutton wrote:
typedef string Colour;
struct edge_properties {
vector < set< Colour > & > eColours;
}
No, it won't compile. Template arguments of a vector are required to be default constructible.
The template arguments of vector are only required to be CopyConstructible and Assignable. In Christ, Steven Watanabe
participants (3)
-
Andrew Sutton
-
John Robertson
-
Steven Watanabe