The only safe way to do this is to not depend on the type of the extension
ID at all.  For example:

template <typename T>
void foo(Message* message, const T& extension_id) {
  message->SetExtension(extension_id, 123);
}

On Sat, May 1, 2010 at 5:30 AM, Adagio <adagiograzi...@gmail.com> wrote:

> Hi,
>
> Is it possible to use extension id as a parameter to C++ templates?
>
> If yes, should it be declared as a pointer/reference to a object
> (seeing that the extension identifier is actually a global object)?
> (an example would help very much!)
>
> Finally is it future-safe considering ExtensionIdentifier is in the
> google::protobuf::internal namespace?
>
> Adagio
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to proto...@googlegroups.com.
> To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com<protobuf%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
>
>

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

Reply via email to