Advertisement

Query class for inherited mixins from application

Started by May 19, 2019 02:26 AM
1 comment, last by WitchLord 5 years, 6 months ago

Given:

mixin class Foo {}

class Bar : Foo {}

Is there a way to determine from the C++ side that Bar inherits from Foo?

 

edit: I finally figured out how to search this forum, and it looks like the answer is no, the mixin information doesn't persist past compilation and the closest approximation would be using metadata?

On 5/18/2019 at 11:26 PM, belenar said:

the mixin information doesn't persist past compilation

Correct. Once the script is compiled, there is no way to tell which if the code was produced via a mixin or simply a copy of the script code.

For what reason do you need to know that the mixin was used? metadata might be used, but you could potentially also solve it by using interfaces. 


interface iFoo {}

mixin class Foo : iFoo {}

class Bar : Foo {} // Now Bar implements interface iFoo due to mixin Foo

 

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement