[Library Release] dproto

Matt Soucy msoucy at csh.rit.edu
Tue Oct 8 12:27:58 PDT 2013


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-announce/attachments/20131008/95d43585/attachment.pgp>


More information about the Digitalmars-d-announce mailing list