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

 
fxsaber:

Unfortunately, I never saw an example of how to use it.

Well, for example, creating an array of objects of different types.
 
Vladimir Simakov:
Well, for example, creating an array of objects of different types.

Above gave an example of this myself. But then how do you refer to them if you don't know the types?

 
fxsaber:

Above gave an example of this myself. But then how do you address them if you don't know the types?

How can I not know? I put them there myself, i.e. their list is final. You can do it by trying types in this list, dynamic_cast to help.

 
Vladimir Simakov:

How do you not know? I put them there myself, i.e. their list is finite. You can use dynamic_cast to help.

Well, that's a crutch solution!

 

In MQ, for example, ArrayCopy is based on void*. When I need to modify it, I use a template. And everything works, of course, and strictly by specified types.

That's why I can't find any convenient void* script yet. Apparently, I see the possibilities this construct provides narrowly.

 
fxsaber:

Well, that's a crutch solution!

Well, if the man wants it, why screw it up? And then, why is it a crutch? If free resources allow, why not? So, Java is one big crutch, and assembler rules. In the end we have desire but no possibilities, and it's not clear why, and it's not good, we should fix it.

 
Vladimir Simakov:

Well, if a person wants it, then why screw it up. And then, why screw it up? If the free resources allow, then why not. So, Java is one big crutch, and assembler generally rules. In the end we have desire but no possibilities, and it's not clear why, and it's not good, we should fix it.

Not against this chip. I ask in order to learn new and useful things. That's why I'm on the forum in many ways.

 
fxsaber:

In MQ, for example, ArrayCopy is based on void*. When I need to modify it, I use a template. And everything works, of course, and strictly by specified types.

But it doesn't copy any pointers, only compatible ones that are cast implicitly. All user-defined functions used to work that way too and it was very convenient. Now it's either a matter of working with templates or recopying into a new array. It's unclear who wanted to cut it down and why.

 
Alexey Navoykov:

But it doesn't copy any pointers, but only compatible ones that are cast implicitly. All the user functions used to work that way too and it was very convenient. Now you either have to make it with templates or copy it into a new array. I don't know who wanted to cut it down and why.

How was it possible before. It seems like the types were always supposed to match.

 
Alexey Navoykov:

Compiler error. Bild 1961.

And in 1961x32 everything works... nice!
Reason: