quote:
The extra size of the language required to support templates is almost trivial, isn''t it? One new keyword, two new contexts...
Don''t you mean two new keywords
quote:
The extra size of the language required to support templates is almost trivial, isn''t it? One new keyword, two new contexts...
quote: Original post by An Irritable Gent
> which is faster, using classes, or using straight code?
Impossible to answer. :-)
> But isn''t it just that little bit slower because you have to pass the ''this'' pointer to every method?
If you don''t use classes (and thus the hidden "this" pointer), you''d end up having to dereference a pointer, or pass an extra pointer yourself anyway. Besides, if passing an additional single pointer is producing a significant slow-down in performace, something''s wrong with your design. Or try inline. :-)
> Another thing, is it really as easy to write a program using classes as it is to write code like you would in C? Or is it easier?
I used to be an "only C" programmer. When I started learning C++, it took me a couple months to really get the hang of things. Now, for me, I have trouble thinking of how to approach a programming problem *without* using classes. But that''s the nice thing about C++ - as you''re learning it, you can still use as much "only C" as you want to minimize the learning curve.
the Gent
// C++ classes
Matrix m1, m2;
// C++ module
?
quote: They used to just use the "class" keyword, but then they changed it to allow the "typename" keyword.
quote:
Either way, my numbers are off: 1 more context or one more keyword.
T::something myVar;
matrix_handle matrices[3];
for( int x=0; x < 3; x++ )
matrices[x] = create_matrix;
quote: Original post by null_pointer
5) If the post says something we don''t understand, it''s stupid.