Header files is that thing for me. I hate that I need to create and maintain two files for every non-trivial class.
Printable View
Header files is that thing for me. I hate that I need to create and maintain two files for every non-trivial class.
Implicit conversions. They are so evil that they're nearly useless when you want to overload operators such as operator T or operator bool.
The fact that you can't make them explicit annoys me.
This isn't going to be another one of those poll threads like in GD, is it?
QuantumPete
But I thought you like adding conversion operators to your classes? Did you change your mind?
As for me, I'm not too fond of the whole C side of C++ and the inconsistencies.
It would also be nice if all types had a standard size instead of leaving so much of the language as implementation defined.
Really? Wow. Color me lucky...Quote:
They never work as expected, so this is a major failing in the language.
Ditto.Quote:
As for me, I'm not too fond of the whole C side of C++ and the inconsistencies.
Soma
I dont like Herbie's teachings -- but I never read his books anyway.
You do mean Schildt I hope?! O_oQuote:
I dont like Herbie's teachings -- but I never read his books anyway.
Soma
swgh must be referring to Herb Sutter :)Quote:
You do mean Schildt I hope?! O_o
requiring goto to break/continue in nested loops
No default types for template arguments, mandatory specialisation of all arguments following a one which has been specialised. This latter point implies a profound reflection about the order of the template arguments, even before coding!, and which makes code much less maintainable....
What? O_oQuote:
mandatory specialisation of all arguments following a one which has been specialised
Example?
Soma
Yeah, that's exactly what I mean....Quote:
but not for functions
Josuttis an Vandevoorde mention in their book "C++ Templates" that very, very probably the next standard will allow default types for template arguments, as well as a 'double' as non-type template argument. They say that there are no technical difficulties in doing so. Can't wait...
I agree. C++ is missing that one :)
pseudo-codeQuote:
Example?
What if I've designed my template class, later I decide to add a function 'function' with only its first argument specialised? As far as I know, after a partial specialisation everything has to be specialised.Code:template<typename T1, typename T2>
class TestClass {
....
__ function();
}
template<typename T2> // partial specialisation for first template argument, #error!
__ class<char, T2> :: function()
Henceforth, this will work:
EDIT: This is especially horrible with traits... along the road you discover over and over again the "correct" order of the argumentsCode:template<typename T1> // partial specialisation for second template argument, OK
__ class<T1, char> :: function()