[omniORB] compiling template with I::_ptr_type *
Janet Tvedt
tvedt@noao.edu
Mon, 29 Jan 2001 14:33:42 -0700 (MST)
A few months ago I posted a message (details below). However,
I cannot get the following template function to compile:
template <class Type>
int getCosNamingObjectRef(Type::_ptr_type *a, ...
I am using omniORB3.0.2 and gcc version 2.95.2 under
Solaris 2.8. Am I missing an include file or a compiler
option?
--------------------------------------------------------------------------
Janet Tvedt, National Solar Observatory/SOLIS Internet: tvedt@noao.edu
P.O. Box 26732, Tucson, AZ 85732-6732 Phone: (520) 318-8388
950 N. Cherry Ave., Tucson, AZ 85719 FAX: (520) 318-8278
> There is no work-around for non-compliant code which uses Echo*. I'm
> afraid you will have to change all uses of Echo* to Echo_ptr.
>
> > I ask because I am porting lots of code that uses the * version
> > and a general name resolution template function that has a
> > parameter Type ** as shown below:
> > template <class Type>
> > int getCosNamingObjectRef(Type **a, ...
>
> For this sort of thing, it's not as bad as it might be, because the
> C++ mapping helps out. You can use:
>
> template <class Type>
> int getCosNamingObjectRef(Type::_ptr_type *a, ...
>
> Since the C++ mapping says that for interface I, I::_ptr_type is a
> typedef to I_ptr. You won't have to change all calls to the template
> function, just the declarations of the object reference variables you
> pass to it.
>
> Cheers,
>
> Duncan.
>
> --
> -- Duncan Grisby \ Research Engineer --
> -- AT&T Laboratories Cambridge --
> -- http://www.uk.research.att.com/~dpg1 --
>
>