On 10/08/2013 04:11 AM, Kagamin wrote: > On Saturday, 5 October 2013 at 20:56:21 UTC, Matt Soucy wrote: >> message Point { >> optional int32 x = 1 [default=166]; >> required int32 y = 2; >> optional string label = 3; >> message Coord { >> required int32 a = 1; >> required int32 b = 2; >> } >> } >> >> You can get a structure that behaves as: >> >> struct Point { >> int x=166; >> int y; >> string label; >> struct Coord { >> int a,b; >> } >> } > > Should it be really like that? If you just declare Coord struct, it > doesn't place a Coord instance in Point. No, that's intentional. The idea was to show the possibility of nested structs. You can create a Coord with:
auto c = Point.Coord(); I admit the example is kind of poor, though. -Matt Soucy
signature.asc
Description: OpenPGP digital signature