I think you mean class forward reference but that is as you said defining the class name before the full implementation. Can you give a sample code?
Here is the example:
Compiler Error: 'Stuff' - Declaration without type
First of all, couldn't agree more about indentation. I waste more time making code more readable than writing the code itself. However i don't think implementation of tab characters are possible because it would cause the text control to leave focus on most operative systems, so i have never complained about it until now. Don't know if it is possible to use CSS styling to achieve the results.
About the example code, it is indeed a class forward reference and it is solved using the same thing you said:
class Stuff; // Declaring the class name here does the thing. class Context { public: void doSomethingOnStuff (Stuff* stuff) { stuff.doSomething (GetPointer (this)); } }; class Stuff { public: void doSomething (Context* c) { Print ("Doing in context..."); } }; // Lots of spaces for indentation by the way.
So, i still don't understand what you mean by circular class dependency.
Is indentation an option in this forum?
Please edit/write your codes with SRC button, like TripleHeinz did.
Sadly, nope, there's no indentation in the forum, it's up to user's writing style, https://en.wikipedia.org/wiki/Indent_style.
You can always copy paste from MetaEditor ;)
Sorry for the late answer
Print ("Yo, thanks phi.nuts");
TripleHeinz, you're right. You don't understand cause I made a mistake ;)
And yet, I have some disappointment about MetaEditor.
At my job I use Netbeans IDE with Java: there is no level of comparison. I know I can sound boring or freakish and I don't care. I know metaquotes can do a better product!
- Why only 64 bytes in path length? Just try to consider I'd like to give some structure to my code... To me, this limitation is annoying. Seriously: is this a life saver feature or something?
- by declaring classes before their implementation everything compile correctly, yes... But i lose the autocompletion feature... it's just like a regular text editor with a "compile plug-in".
- The styler can't be customized, and I don't like mql5 indentation standard (can I say this?)
- There are no smart shortcuts (such as "toggle line comment" CTRL+SHIFT+C, which I love in netbeans)
- There is no autocompletion in the #include construct.
- There is no wildcards in the #include construct.
My list could be much much long...
Just eih: it's 2013!
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Like a regular C++ compiler, MQL5 doesn't allow circular class dependency... and that's just... regular.
Well, dear Metaquotes,
since you introduced a variety of modification in your own language,
such as dynamic arrays, automatic memory allocation, function templates, and so on... why don't you consider to permit circular class dependency?
I must admit it takes a lot of time to me to avoid circular class dependency when designing classes structure... and that's very annoying.
I know I can define a class name before defining the full class structure... and that's just not sufficient... think to Java: that's what I'm talking about.