template <T> bool object.is(void) member function

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

template <T> bool object.is(void) member function

Costas Tsirogiannis

 Greetings,

 Is the .is() member function of CGAL::Object still existing?

It is listed here: http://www.cgal.org/Manual/latest/doc_html/cgal_manual/STL_Extension_ref/Class_Object.html#Cross_link_anchor_1811

If it try to call it I get this strange compilation error :

error: expected primary-expression before ‘>’ token
error: expected primary-expression before ‘)’ token
 
I looked in the header file of CGAL::Object and Handle_for_virtual but it doesn't seem listed there.

Is there another way to get this boolean out without trying a CGAL::assign?

Thanks!

Constantinos
Reply | Threaded
Open this post in threaded view
|

Re: template <T> bool object.is(void) member function

Sylvain Pion
Administrator
Le 10/06/10 14:57, Costas Tsirogiannis a écrit :

>
>   Greetings,
>
>   Is the .is() member function of CGAL::Object still existing?
>
> It is listed here:
> http://www.cgal.org/Manual/latest/doc_html/cgal_manual/STL_Extension_ref/Class_Object.html#Cross_link_anchor_1811
>
> If it try to call it I get this strange compilation error :
>
> error: expected primary-expression before ‘>’ token
> error: expected primary-expression before ‘)’ token
>
> I looked in the header file of CGAL::Object and Handle_for_virtual but
> it doesn't seem listed there.
>
> Is there another way to get this boolean out without trying a CGAL::assign?

Hi Costas,

Are you using a recent enough version of CGAL ?

If you are in a template context, your compiler may require you
to call it as "obj.template is<T>()".

--
Sylvain

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss

Reply | Threaded
Open this post in threaded view
|

Re: template <T> bool object.is(void) member function

andreas.fabri
On 10/06/2010 15:06, Sylvain Pion wrote:

> Le 10/06/10 14:57, Costas Tsirogiannis a écrit :
>>
>> Greetings,
>>
>> Is the .is() member function of CGAL::Object still existing?
>>
>> It is listed here:
>> http://www.cgal.org/Manual/latest/doc_html/cgal_manual/STL_Extension_ref/Class_Object.html#Cross_link_anchor_1811
>>
>>
>> If it try to call it I get this strange compilation error :
>>
>> error: expected primary-expression before ‘>’ token
>> error: expected primary-expression before ‘)’ token
>>
>> I looked in the header file of CGAL::Object and Handle_for_virtual but
>> it doesn't seem listed there.
>>
>> Is there another way to get this boolean out without trying a
>> CGAL::assign?
>
> Hi Costas,
>
> Are you using a recent enough version of CGAL ?
>
> If you are in a template context, your compiler may require you
> to call it as "obj.template is<T>()".
>


Hi Costas,

and instead of assign you should use object_cast

best,

andreas

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss

Reply | Threaded
Open this post in threaded view
|

Re: template <T> bool object.is(void) member function

Costas Tsirogiannis
 Indeed, this extra "template" before "is" made it work.
Why is this needed in the present case?
 Normally a templated member function can be called without it.

Thanks!

Constantinos


On Thu, Jun 10, 2010 at 3:10 PM, Andreas Fabri <[hidden email]> wrote:
On 10/06/2010 15:06, Sylvain Pion wrote:
Le 10/06/10 14:57, Costas Tsirogiannis a écrit :

Greetings,

Is the .is() member function of CGAL::Object still existing?

It is listed here:
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/STL_Extension_ref/Class_Object.html#Cross_link_anchor_1811


If it try to call it I get this strange compilation error :

error: expected primary-expression before ‘>’ token
error: expected primary-expression before ‘)’ token

I looked in the header file of CGAL::Object and Handle_for_virtual but
it doesn't seem listed there.

Is there another way to get this boolean out without trying a
CGAL::assign?

Hi Costas,

Are you using a recent enough version of CGAL ?

If you are in a template context, your compiler may require you
to call it as "obj.template is<T>()".



Hi Costas,

and instead of assign you should use object_cast

best,

andreas


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: template <T> bool object.is(void) member function

Laurent Rineau (GeometryFactory)
On Thursday 10 June 2010 15:47:58 Costas Tsirogiannis wrote:
>  Indeed, this extra "template" before "is" made it work.
> Why is this needed in the present case?
>  Normally a templated member function can be called without it.

Normally, this keyword is only required to call template member functions of
types whose identifier is a dependent name (a name whose semantic may depend
on the template parameters). Is your "Object" type equal to K::Object_2 (or
Object_3) with K passed as template parameter?

--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory           http://www.geometryfactory.com/
Release Manager of the CGAL Project       http://www.cgal.org/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss

Reply | Threaded
Open this post in threaded view
|

Re: template <T> bool object.is(void) member function

Costas Tsirogiannis
> Is your "Object" type equal to K::Object_2 (or Object_3) with K passed as template
> parameter?

Yes,  something quite similar to that.  Thanks for the clarification.

While this part of this code does not pop any compilation errors, I now
get at a totally different point an error for a similar call:

‘class CGAL::Object’ has no member named ‘is’

Though there I put again `template' in front of 'is'. Any suggestion as to what causes that?

thanks again,

Constantinos



On Thu, Jun 10, 2010 at 4:07 PM, Laurent Rineau (GeometryFactory) <[hidden email]> wrote:
On Thursday 10 June 2010 15:47:58 Costas Tsirogiannis wrote:
>  Indeed, this extra "template" before "is" made it work.
> Why is this needed in the present case?
>  Normally a templated member function can be called without it.

Normally, this keyword is only required to call template member functions of
types whose identifier is a dependent name (a name whose semantic may depend
on the template parameters). Is your "Object" type equal to K::Object_2 (or
Object_3) with K passed as template parameter?

--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory           http://www.geometryfactory.com/
Release Manager of the CGAL Project       http://www.cgal.org/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: template <T> bool object.is(void) member function

Laurent Rineau (GeometryFactory)
On Thursday 10 June 2010 18:23:48 Costas Tsirogiannis wrote:

>  > Is your "Object" type equal to K::Object_2 (or Object_3) with K passed
>  > as
>
> template
>
> > parameter?
>
> Yes,  something quite similar to that.  Thanks for the clarification.
>
> While this part of this code does not pop any compilation errors, I now
> get at a totally different point an error for a similar call:
>
> ‘class CGAL::Object’ has no member named ‘is’
>
> Though there I put again `template' in front of 'is'. Any suggestion as to
> what causes that?

Well, this time it probably means that you are compiling with an old version
of CGAL, when CGAL::Object had not the template member function 'is'. :-)

Which CGAL version are you using?

--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory           http://www.geometryfactory.com/
Release Manager of the CGAL Project       http://www.cgal.org/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss

Reply | Threaded
Open this post in threaded view
|

Re: template <T> bool object.is(void) member function

Costas Tsirogiannis
> Well, this time it probably means that you are compiling with an old version
> of CGAL, Which CGAL version are you using?

3.5.1  .  Should I upgrade?   :)



On Thu, Jun 10, 2010 at 7:07 PM, Laurent Rineau (GeometryFactory) <[hidden email]> wrote:
On Thursday 10 June 2010 18:23:48 Costas Tsirogiannis wrote:
>  > Is your "Object" type equal to K::Object_2 (or Object_3) with K passed
>  > as
>
> template
>
> > parameter?
>
> Yes,  something quite similar to that.  Thanks for the clarification.
>
> While this part of this code does not pop any compilation errors, I now
> get at a totally different point an error for a similar call:
>
> ‘class CGAL::Object’ has no member named ‘is’
>
> Though there I put again `template' in front of 'is'. Any suggestion as to
> what causes that?

Well, this time it probably means that you are compiling with an old version
of CGAL, when CGAL::Object had not the template member function 'is'. :-)

Which CGAL version are you using?

--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory           http://www.geometryfactory.com/
Release Manager of the CGAL Project       http://www.cgal.org/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: template <T> bool object.is(void) member function

Laurent Rineau (GeometryFactory)
Le jeudi 10 juin 2010 19:10:29, Costas Tsirogiannis a écrit :
> > Well, this time it probably means that you are compiling with an old
>
> version
>
> > of CGAL, Which CGAL version are you using?
>
> 3.5.1  .  Should I upgrade?   :)

Search for the differences:
http://www.cgal.org/Manual/3.5/doc_html/cgal_manual/STL_Extension_ref/Class_Object.html
http://www.cgal.org/Manual/3.6/doc_html/cgal_manual/STL_Extension_ref/Class_Object.html

Apart the release number in the footer (and numbers in links), there is only
one visible difference... Guess what is the difference?

You should upgrade to CGAL-3.6 (whose documentation you refer to), or not use
is<T>(). If you want to stick to CGAL-3.5.1, instead of:
  obj.is<T>()
you can use:
  CGAL::object_cast<T>(&obj) != NULL

--
Laurent Rineau, PhD
Release Manager of the CGAL Project       http://www.cgal.org/
R&D Engineer at GeometryFactory           http://www.geometryfactory.com/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss

Reply | Threaded
Open this post in threaded view
|

Re: template <T> bool object.is(void) member function

Costas Tsirogiannis
>Apart the release number in the footer (and numbers in links), there is only
>one visible difference... Guess what is the difference?

Hmmm, difficult to see :P

Ok, thanks!

On Thu, Jun 10, 2010 at 9:45 PM, Laurent Rineau (GeometryFactory) <[hidden email]> wrote:
Le jeudi 10 juin 2010 19:10:29, Costas Tsirogiannis a écrit :
> > Well, this time it probably means that you are compiling with an old
>
> version
>
> > of CGAL, Which CGAL version are you using?
>
> 3.5.1  .  Should I upgrade?   :)

Search for the differences:
http://www.cgal.org/Manual/3.5/doc_html/cgal_manual/STL_Extension_ref/Class_Object.html
http://www.cgal.org/Manual/3.6/doc_html/cgal_manual/STL_Extension_ref/Class_Object.html



You should upgrade to CGAL-3.6 (whose documentation you refer to), or not use
is<T>(). If you want to stick to CGAL-3.5.1, instead of:
 obj.is<T>()
you can use:
 CGAL::object_cast<T>(&obj) != NULL

--
Laurent Rineau, PhD
Release Manager of the CGAL Project       http://www.cgal.org/
R&D Engineer at GeometryFactory           http://www.geometryfactory.com/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss