Hi, the GiNaC documentation says: In contrast, 'is_exactly_a<T>(e)' allows you to check whether the top-level object of an expression 'e' is an instance of the GiNaC class 'T', not including parent classes. Shouldn't this read "not including subclasses"? Otherwise, I don't understand what the documentation wants to say. Greetings, Jan
Dear Jan,
On Mon, 19 Jun 2017 18:24:21 +0200, Jan Rheinländer <jrheinlaender@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/
participants (2)
-
Jan Rheinländer
-
Vladimir V. Kisil