Ah.. Just try translating and replacing about 50% C++ code with assembly....
In my opinion assembly is the fastest, and optimizing them by assembly is a great choice... :)
I'm trying getting function addresses from structures. But, something blocks me, and here is an example :
1 2
void * begin = std::vector::begin;
void * value = Stack::value;
Anyways it only gives crazy compling errors... Am I doing anything wrong? :(
Unless your compiler is braindead, it will probably write better, faster, smaller, and more efficient assembly than you ever will, even with optimizations disabled.
I am making & writing documentation. So now no need to post long updates... :) About documentation : Which file format is best? CHM, HTML, or anything else?
Macro library is almost done. I only try to complete code replacing, that means it will compile the string inside the macro instead (If it supports). An example "DECIMAL" contains "double", so certainly the parser will find and compile the inside string "double" of the macro. "Macro" also has a higher level of precedence than functions and numbers. :)
Yes; std::vector::begin() is a function, not a variable.
No. But actually a function also is an address, right? Every function contains its address information so that the program can locate and then call them exactly.
So what I really need is "function address". It's not a common function variable, it's "structure -> function". Come back to the example :
Wow! With template function I successfully converted a function member to an address!!!!
Because C++ does not support __thiscall definition, so I had a new idea : Defining a template function instead. It's much simpler I think :)
-> Firstly, see my goal above :D
And here, this is a trick which can get function member address easily :
It's so awesome!!! Wow, The hardest problem has been solved!!!!!!!!!!!!!!!!!!!
How does it work?
In this example the union variable ADDRESS::void (F::*func)() stores the address of the member function NUMBER::PRINT and then next, ADDRESS::function_address returns the function address...
But, what is the hell? (I HAVE TO CREATE A NEW TEMPLATE FOR EVERY SET OF ARGUMENT TYPES) :(
Like I mentioned before, the comment //Only for syntax "void FUNC(void)" , you will see it's extremely specific. Imagine it looks like "LOCK" - "KEY". Each template can only handle a single specific case. If you pick a wrong converter, the process will fall which result in compiling errors.
Finally four remaining functions NUMBER::GETA, NUMBER::SETA, NUMBER::GETB, NUMBER::SETB : Cry!!!
address_data.func = Function;
cannot convert from 'void (__thiscall NUMBER::*)(int)' to 'void (__thiscall NUMBER::*)(void)'
Details : Their addresses are unknown, just because they have their different syntax.
-> So with structure example, at least I have to make two other versions of converter to get their addresses properly!!
Does anyone have any idea "the generic version of the converter which is able to convert any function member to address"? Any help would be very helpful XDXD
@coder777
Wow. I never have seen this. It's very new to me. Very interesting!!! XDXD
But, I have some questions : Can the boost function member variable be converted into a *void address value? Is it structure or regular value? And could you show me an example how to get, store the result into a void* then print the output address of a member function properly? :)
EssGeEich - it is just because I want to know more information - check others before implementing :)
I picked this thread as being complete BS near the start, and I was criticised for not being tolerant enough.
So then we had about 500 posts of more BS. Then Jackson Marie had her? account restricted (not sure what led to that, but presumably warned by admin), then renamed to Imadatobanisa. I didn't believe one word of the excuses posted in the OP's Bio at that time. Account reinstated, now more of the same BS.
I can only think that it keeps continuing because people continue to reply.
Also, I think that it may be one of the strategies of a troll to take on a female role to try to endear themselves to the male members on this site. I wouldn't be the least surprised if the OP was really a middle aged man on the same psychological plane as those who write viruses.
@EssGeEich
I agree with you too. Questions about loops and cout, but code with templates & asm?
Of course the real proof would be for the OP to post all the code, but I very much doubt that will happen. Others have requested it, and it hasn't happened yet. If code was posted I think it would be rather easy to spot the difference between your original code, and the OP's
I think time-wasters like the OP should have a permanent ban. If you are not happy - send a message to admin.
Any way this is all my opinion, but I would urge others to help stop this continued non sense.