[GiNaC-devel] is_exactly_a
Vladimir V. Kisil
kisilv at maths.leeds.ac.uk
Wed Jun 21 12:24:48 CEST 2017
Dear Jan,
>>>>> On Mon, 19 Jun 2017 18:24:21 +0200, Jan Rheinländer <jrheinlaender at gmx.de> said:
JR> In contrast, 'is_exactly_a<T>(e)' allows you to check whether
JR> the top-level object of an expression 'e' is an instance of the
JR> GiNaC class 'T', not including parent classes.
JR> Shouldn't this read "not including subclasses"? Otherwise, I
JR> don't understand what the documentation wants to say.
Consider:
varidx k(symbol("k"),2);
cout << is_a<idx>(k) << endl; // -> 1
cout << is_exactly_a<idx>(k) << endl; // -> 0
So, varidx k is an instance of idx, but not exactly idx---since the
parent class idx of the class varidx is not included in the test
is_exactly_a. The wording seems to be right to me.
Best wishes,
Vladimir
--
Vladimir V. Kisil http://www.maths.leeds.ac.uk/~kisilv/
Book: Geometry of Mobius Transformations http://goo.gl/EaG2Vu
Software: Geometry of cycles http://moebinv.sourceforge.net/
More information about the GiNaC-devel
mailing list