如何从模板开始? [英] how to start with templates ??

查看:80
本文介绍了如何从模板开始?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

全部,好吧,我是一名VC ++程序员(已有2年以上)..但到现在为止,我已经从未在模板上工作了。我已经开发了整个产品,但

从未在模板上工作或在我的应用程序中使用它们......


但是现在,我认为作为一个成熟的程序员,这就是我所拥有的东西

没有学到..并且想要从模板开始,所以,你可以请

指导我从哪里开始?

模板的一般含义是什么?


任何人都可以向我提供模板的任何基本示例我来自哪里
可以开始了解模板基础...


你请给我一些小代码片段通过

模板做点什么..

谢谢,


Jigar Mehta

盖茨信息系统列兵。有限公司

印度

Hye all,
I am a VC++ programmer (have exp. of 2+ years).. But till now, I
have never worked on templates.. I have developed whole products but
never worked on templates or used them in my applications...

But now, I think as a full-fledged programmer, this is the thing I have
not learned.. And want to start with templates, so, can you please
guide me from where to start with ?? What is the general meaning of
template ??

Can anybody present me with any basic example of templates from where I
can start understand template basics...

You please give me small snippet that does something through
templates..
Thanks,

Jigar Mehta
GATES Information Systems Pvt. Ltd.
India

推荐答案



Jigar Mehta写道:

Jigar Mehta wrote:
任何人都可以向我提供模板的任何基本示例,其中
我可以开始了解模板基础...

你请给我一个小片段通过
模板做某事..
Can anybody present me with any basic example of templates from where I can start understand template basics...

You please give me small snippet that does something through
templates..




有很多好书可以帮助你解决这个问题。我听说过有关The C ++ Primer的好消息。 Lippman和Thinking in C ++通过

Eckel,可以在网上免费获得。当然,你也可以看看好的旧版The C ++ Programming Language。作者:Stroustrup。



There are lots of good books that will help you with this. I''ve heard
good things about "The C++ Primer" by Lippman and "Thinking in C++" by
Eckel, which is freely available on the web. Of course, you could also
have a look at good old "The C++ Programming Language" by Stroustrup.


2005年1月27日22:48:33 -0800,Jigar Mehta< ji ******** @ gatescorp。 com>

写道:
On 27 Jan 2005 22:48:33 -0800, Jigar Mehta <ji********@gatescorp.com>
wrote:
但是现在,我认为作为一个成熟的程序员,这是我没有学到的东西..并且想从模板开始,那么,请你指导我从哪里开始?
模板的一般含义是什么?


正如变量允许你参数化值,模板允许你

参数化数据类型。


take看看例如一些标准容器。 < list>,< vector> ;,看看

如何使用模板。

顺便说一句。我无法相信你到目前为止从未使用过这些课程......

任何人都可以向我提供模板的基本示例,我可以从这里开始理解模板基础...

你请给我一些通过
模板做一些事情的小片段。
But now, I think as a full-fledged programmer, this is the thing I have
not learned.. And want to start with templates, so, can you please
guide me from where to start with ?? What is the general meaning of
template ??
just as variables allow you to parametrize values, templates allow you to
parametrize data types.

take a look at some standard containers in eg. <list>, <vector>, to see
how templates are used.
btw. i cannot believe that you never worked with these classes so far...
Can anybody present me with any basic example of templates from where I
can start understand template basics...

You please give me small snippet that does something through
templates..




std - 库里面装满了片段。


的概述我建议Stroustrup的The C ++ Programming Language,对于

高级别的东西,我可以推荐Alexandrescu''现代C ++设计> ;.


警告:使用模板需要的时间比没有它们需要两倍,

和(编译时)错误很多更难找...


-

祝你有愉快的一天

ulrich



std - library is full of "snippets".

for an overview i suggest Stroustrup''s "The C++ Programming Language", for
high level stuff i can recommend Alexandrescu''s "Modern C++ Design".

be warned: using templates need''s twice the care than doing without them,
and (compile time) bugs are much harder to find...

--
have a nice day
ulrich




ulrich写道:

ulrich wrote:
看看例如一些标准容器。 < list>,< vector>,到
看看如何使用模板。
take a look at some standard containers in eg. <list>, <vector>, to see how templates are used.




如果你还不熟悉STL,我*高度*推荐你

获得有效STL的副本作者:Scott Meyers。这本书改变了我的生活!



If you''re not already proficient with the STL, I *highly* recommend you
get a copy of "Effective STL" by Scott Meyers. This book changed my
life!


这篇关于如何从模板开始?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆