开发者

What to do with students after templates were explained? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.

I'm having a C++ seminar in 30 minutes :-)

Because I incorporated most of the examples I usually do on the seminar into the lecture I don't have anything to do with my students. I jus开发者_如何学JAVAt gave them a broad overview of templates (from basics to advanced topics).

Any tips what to do?

It can be something that I will explain (step-by-step), or something they will have to code.


Replicate containers - like a list or a vector.


How about trying to implement templates that mirror or are similar to those currently in the STL?

It will give them practice in developing them.


You can challenge them with a "can-be-a-real-system"... and ask them what possible best-practices...


Once you've delivered the basics of templates, point them in the direction of the standard template library and have them get their head around using std::list, std::vector etc to store arrays of objects and iterate through them.

It's easier to implement your own template code, once you understand their advantages. So using the STL should be their next step.

After that, point them at boost ;)


If you haven't yet covered the STL, you could introduce them to that. It is a good example of why templates are extremely useful.

You could also introduce them to iterators using this approach. IMO, learning the STL is one of the most useful things you can learn in C++ :-)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜