You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Self-destruct? - that's new :).
Yep, self-destruct. I assume you are aware that this is the difference between "stack" objects and dynamic objects - they don't ask you when to delete themselves, they do it when they exit the originating program block :)
You've probably heard of copy/move constructors/operators, right?
obj o; { obj q; o = q; o = move(q); // С++ вариант, более эффективный }
You've probably heard of copy/move constructors/operators, right?
So we'll be on the lookout for that crucial moment and copy it that way, if only we're not too late? :lol:
Just because we really don't like OOP, or are there other ulterior reasons?
So we'll be on the lookout for that crucial moment and copy it that way, if only we're not too late? :lol:
Just because we really don't like OOP, or are there other ulterior reasons?
Of course, how else could there be? You as a decent proger must manage dynamic objects via stack ones too (RAII technique)
Of course, how else could it be? As a decent proger, you have to manage dynamic objects via stack objects as well (RAII technique).
Do you mean the rubbish collector? )))) or about counting number of references. i've been practicing these things lately. but performance of all these approaches is lame in µl unfortunately
No, not about rubbish collector, but about smart pointers - unique_ptr, shared_ptr (with reference counting), RAII easily googled. Generally there is no extra cost for unique_ptr in terms of memory (wrapper == pointer size), and calls are over-optimized, but in µl everything is sad, yes. But it's not needed here either (smart pointers).
Or you could take the templates and write something like:
https://www.mql5.com/ru/forum/295485/page18#comment_9971363
Button is also detail-independent, without all the polymorphism and interfaces. Polymorphism has its own niche, but it is much narrower than they say.
In such a simplified example, the template certainly looks more convenient. In fact, you don't even need a template there, since you only have one instance.
This simplified example certainly makes the template look more convenient. In fact, you don't even need a template there, since you only have one instance.
Button lamp via g with virtuality:
hackneyed examples.