U++ Forum - RDF feed
https://www.ultimatepp.org/forums/
How to add a struct to a U++ container?
https://www.ultimatepp.org/forums/index.php?t=rview&goto=38599&th=7198#msg_38599
struct Person {
String n;
int a;
Person(String name, int age) {
n=name; a=age;
}
};
Then I need to add persons like this:
VectorMap<int, Person> m;
m.Add(1, Person("John", 30));
But it gives me compile error. Any ideas?]]>lectus2012-12-26T23:21:13-00:00Re: How to add a struct to a U++ container?
https://www.ultimatepp.org/forums/index.php?t=rview&goto=38600&th=7198#msg_38600
http://www.ultimatepp.org/forum/index.php?t=msg&goto=230 31&&srch=add+struct+to+container#msg_23031
It should be Moveable or use ArrayMap.
Sorry for this thread. I should have searched it before. You can delete it if you want.]]>lectus2012-12-26T23:27:38-00:00