1. more plain and then readable code
package::CONSTANT_NAME vs 
package::Constants::default_instance().constant()
2. compile time const is irreplaceable for many C++ code, such as array 
bound and template value parameter.
3. safety, default value can be changed careless.

在 2013年1月26日星期六UTC+8上午10时28分39秒,moofish写道:
>
> Field options can provide this capability unless you are really looking 
> for the ability to just not type the same value? I would think the default 
> value and field options would work.  It is possible I don't fully 
> understand your use case. 
>
> On Thursday, January 24, 2013 9:23:39 AM UTC-8, prot...@googlecode.comwrote:
>>
>>
>> Comment #11 on issue 60 by chen3f...@gmail.com: Support static values   
>> in .proto files 
>> http://code.google.com/p/protobuf/issues/detail?id=60 
>>
>> Support constant in proto is very useful 
>> const int64 DefaultType = 1000; 
>>
>> optional int64 type = 1 [default=DefaultType]; 
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to