12.27.2010

Drawback

The only drawback of template wrapping classes for more convenient memory management is that you can't use other constructor than the ones without parameters. I tried to atleast add a possibility for "copy constructing" an object from another using the assignment operator, but that does just not work. It ends up in an endless recursion over two copy contructors calling their opponent cause they won't call themself to copy again. It's a problem I never encountered in everyday programming, so it's kind of special. I don't know how to solve it, so I'll just leave there as it is. That's the main drawback of trying to create a complex wrapper system: some things just won't work, logically. And there is no way to this problem I'm aware of. Maybe I should just let it be and don't think about impossible logical constructs that would only work in very few special cases. And as I want to keep my constructs almost absolutely safe, I need to overwrite the copy constructor for all of my classes and thus making it impossible to call the ones from base classes. Even if it would be possible, it would result in logical mistakes inside the language, so I also nothing can be done except for writing a new language. Maybe that's a good starting point. Writing a language that can be translated to standard C++. I think that's the best you can do if you got a safe system and don't want to remake all the stuff other people already archieve. In all cases, I can still make a bytecode for faster execution and translate to C++ later. But well! I'm thinking way to far at the moment...

No comments: