[CLOSED] : Compiler bug with template parameter = void* - page 16

 
Who would argue that you are more talented )
 
Ilya Malev:

And then a follow-up question: why don't you

MASK( t, n )

the whole thing in brackets?

I don't, because brackets are implied here

#define  MASK( t, n )    (-1)

But you don't have that implication - everything has to be strictly "scientific"

 
A100:

Well, then, a follow-up question: why don't you put

brackets in here?

I don't, because parentheses are implied here

But you don't have such an implication - everything must be strictly "scientific".

My t is a type, n is a specific number of powers of two, the mask on it is (1<<(n+1))-1.

#define  TMASK(T,P)   ((((T(1)<<P)-1)<<T(1))+1)

Why I made it more complicated in the second case than in the first you can guess.

 
Ilya Malev:

So I conclude that you put brackets in each particular case. But the compiler cannot do that - it needs strict rules to generate warnings

 
Alexey Navoykov:
I, on the other hand, don't need them to understand logic. So it turns out that I am more talented? )

I was reminded of the army and the catchphrases, a petty officer seems to have uttered a rather clever phrase: "everyone has his own truth" - imho, you are right, but so am I!

;)

PS: unfortunately nowadays talent is measured in terms of money, nothing against it, be more talented, but not to the detriment of the rest ;)

 
Igor Makanu:

Currently, I would like to attach VS form to .dll to MT5 in one simple way )))) - I want to wrap the button click handlers in a class and call them by traversing a pointer array of handler functions, and I want to have in the main EA code the possibility to write the same function names as in VS, i.e. button2_Click() ....button2_Click()

SZZ: This is anEOP problem))))

Don't go on - if you do and post it, how many articles/libraries for creating graphical panels/interfaces will then go into history?

 
A100:

Don't go on and on or if you do and post it, how many articles/libraries for creating graphical panels/interfaces will go down in history then

Alas, it's "too late for that", while I was writing here in the thread, I had already been helped with my thoughts, everything is already done, very compact and all in the style of VS

I'm not going to post anything for a long time, I'm not sorry, but the extra time to collect spit from well-wishers... I've had enough of it offline as well, in practice it's easier to do as they say: never help a fellow if you're not asked for it))

))

 

I wonder, who are these supporters of "no braces"? Practically, there is no code where there is just one line of code under if or for. Even if there is only one line to begin with, it will most likely appear some time later and we'll have to add curly brackets. Initially putting two curly braces is not expensive at all, but if you put them afterwards, you have to run your eyes over the code to find the end of the line.

I assume they are teachers. Because you can observe a very good knowledge of the language, especially of such aspects of it, which are practically of little use, with this tendency to harass them endlessly. At the lecture you write a couple of lines of code and discuss them for an hour and a half, here the question about curly brackets doesn't even arise.

The biggest bug of missing curly brackets occurs when rework and debugging. Let's say we need to print something and add a line, but nobody thinks at that moment that the next line is under if or for. The same happens with modifications - you find a place, add a line and everything is broken. I had such problems many times and not only with myself (I had it only once and since then I immediately write two parentheses). So I recommend everyone to write a pair of curly brackets right after writing if and for. Besides, it is a good protection against lost curly braces, which is the most difficult error for search.

 

There are two other camps:

1. Supporters of a vertical code.

2. Supporters of horizontal code.

Also an interesting topic.

 
Dmitry Fedoseev:

There are two other camps:

1. Supporters of a vertical code.

2. Supporters of horizontal code.

Also an interesting topic.

Combined the main topic of the unnecessary () topic with your new topics into one code:

int sum(int a,int b){return a+b;}
//+------------------------------------------------------------------+
void OnStart()
  {
   Print(sum(3,7));
  }
//+------------------------------------------------------------------+

... went to get popcorn ...