But to do anything that you desire you do have to come up with something similar in design to boost::any. Playing simplistic games with a "dumb" type as a void pointer isn't going to accomplish this goal.
Regards,
Paul McKenzie
Printable View
At a high level, could you describe what you are trying to achieve? Some guru's guru may be able to provide guidance on design etc.
Yes, but why do you want to do this - what are you trying to accomplish? c++ is a typed language.
Because that's how C++ works. If what you wanted could be done, don't you think it would have been done already? If you don't like the fact that the user of the void pointer must know before-hand what to convert it to, then choose another language.
I already mentioned to you that there is no way for anyone to know for sure what a void pointer points to, thereby know what type of cast to use. If I give you a void pointer and no other information, you cannot convert it to another type safely unless you also know what it points to. Again, that's how C++ works.
You still didn't answer the question -- why do you need to do this? C++ is not designed to do this, where an "any" type can be passed around and everyone knows what the "any" is really pointing to.Quote:
- i like be more simple\direct;
- and you know that i need it...
sorry if these don't make sence to some programmers, but i need these new type
It seems that with all of your posts, including this thread, you're trying to turn C++ into another language instead of actually developing applications using C++.
Regards,
Paul McKenzie
IMO he is. He's mentioned his 'new language' from almost his very first post in these forums. I thought he was going to write a compiler/interpreter in c++ for this language. But it seems the plan is to turn c++ itself into this 'language'. I'm not convinced this is possible never mind feasible.Quote:
you're trying to turn C++ into another language instead of actually developing applications using C++.