Talk:C++/Templates 1

From Wikiversity
Jump to navigation Jump to search

Vitor 22:17, 14 August 2007 (UTC): You can help improving the lesson by saying what you had difficulty to understand or what you want to see in it.[reply]

Is it possible to come up with an example with a linked list, where the items can be different objects? --HappyCamper 03:21, 15 August 2007 (UTC)[reply]

Vitor 08:52, 15 August 2007 (UTC): Yes, thanks for asking. I will do that as soon as I have time. Thanks, HappyCamper. You mean item of different types or a list like std::list?[reply]

List like std::list. Maybe we can have something about the standard template library too? --HappyCamper 16:18, 15 August 2007 (UTC)[reply]
Vitor 16:38, 15 August 2007 (UTC): Will do. There's a topic about the STL in C++ page. Edit: Done.[reply]

"you should only define default arguments for templates with more than one type"[edit source]

I disagree. This is valid:

template<class T1 = int>
class Useless
{
public:
 
    T1 value;
};
 
Useless<> value; /* Valid! */

--Ropez 12:58, 19 December 2007 (UTC)[reply]

Indeed, my bad. Fixed already, thanks. Vitor 12:16, 15 March 2008 (UTC)[reply]

Not well formed[edit source]

Your sample program containing a List implementation is not well formed. Any name starting with _ followed by a capitol letter is reserved for implementations, as in the compiler and its library. Though you can get away with this in practice much of the time, it shouldn't be allowed in instructional material. (The preceding unsigned comment was added by 24.18.91.126 (talkcontribs) 22:55, 2 March 2008)

Hello, unknown guy. I suppose you missed the part where I said
it was an immitation of the standard libraries. Vitor 12:15, 15 March 2008 (UTC)[reply]