HPP [英] hpp

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

问题描述

您好,


您认为直接在.hpp文件中编写代码是个好主意吗?

我注意到着名的提升 ;图书馆正在这样做......并没有...... b $ b似乎是C ++编码标准。


谢谢......

Hello,

Do you think it''s a good idea writing code directly in an .hpp file ?
I noticed the famous "boost" library is doing that and... doesn''t
seems to be "C++ coding standard".

thanks...

推荐答案

2008-01-13 12:53,stef写道:
On 2008-01-13 12:53, stef wrote:

您好,


您认为直接在.hpp文件中编写代码是个好主意吗?

我注意到着名的提升图书馆正在这样做......并没有...... b $ b似乎是C ++编码标准。
Hello,

Do you think it''s a good idea writing code directly in an .hpp file ?
I noticed the famous "boost" library is doing that and... doesn''t
seems to be "C++ coding standard".



使用模板时通常需要,因为

模板的定义需要包含在每个使用它的翻译单元中。一个

替代方法(相同的事情)是使用.h文件中的

声明和.hpp文件中的实现,以及

然后在.h文件的底部包含.hpp文件。


-

Erik Wikstr? ?m

When using templates you usually have to, since the definition of the
template needs to be included in every translation-unit that uses it. An
alternative approach (that amounts to the same thing) is to use have the
declarations in a .h-file and the implementation in a .hpp-file, and
then include the .hpp-file at the bottom of the .h-file.

--
Erik Wikstr??m


1月13日下午5:22,Erik Wikstr?m< Erik-wikst ... @ telia.comwrote:
On Jan 13, 5:22 pm, Erik Wikstr?m <Erik-wikst...@telia.comwrote:

2008-01-13 12:53,stef写道:
On 2008-01-13 12:53, stef wrote:

Hello,
Hello,


你认为直接在.hpp文件中编写代码是个好主意吗?

我注意到着名的提升图书馆正在这样做......并没有...... b $ b似乎是C ++编码标准。
Do you think it''s a good idea writing code directly in an .hpp file ?
I noticed the famous "boost" library is doing that and... doesn''t
seems to be "C++ coding standard".



使用模板时通常需要,因为

模板的定义需要包含在每个使用它的翻译单元中。一个

替代方法(相同的事情)是使用.h文件中的

声明和.hpp文件中的实现,以及

然后在.h文件的底部包含.hpp文件。


-

Erik Wikstr? m


When using templates you usually have to, since the definition of the
template needs to be included in every translation-unit that uses it. An
alternative approach (that amounts to the same thing) is to use have the
declarations in a .h-file and the implementation in a .hpp-file, and
then include the .hpp-file at the bottom of the .h-file.

--
Erik Wikstr?m



i认为模板可以作为解决方法导出...我发布了

相同的...

i think templates can be exported as a workaround... i have posted
regarding the same...


Rahul写道:
Rahul wrote:

1月13日下午5:22,Erik Wikstr?m< Erik-wikst ...... @ telia.comwrote:
On Jan 13, 5:22 pm, Erik Wikstr?m <Erik-wikst...@telia.comwrote:

>在2008-01-13 12:53,stef写道:
>On 2008-01-13 12:53, stef wrote:

你好,
Hello,


你认为直接在.hpp文件中编写代码是个好主意吗?

我注意到着名的提升图书馆正在这样做......并没有...... b $ b似乎是C ++编码标准。
Do you think it''s a good idea writing code directly in an .hpp file ?
I noticed the famous "boost" library is doing that and... doesn''t
seems to be "C++ coding standard".


使用模板时通常需要,因为
模板的定义需要包含在每个使用它的翻译单元中。一种
替代方法(相同的事情)是使用.h文件中的
声明和.hpp文件中的实现,然后包含。 hh文件位于.h文件的底部。

- Erik Wikstr?m


When using templates you usually have to, since the definition of the
template needs to be included in every translation-unit that uses it. An
alternative approach (that amounts to the same thing) is to use have the
declarations in a .h-file and the implementation in a .hpp-file, and
then include the .hpp-file at the bottom of the .h-file.

--
Erik Wikstr?m



i think templates can作为解决方法导出...我发布了

相同的...


i think templates can be exported as a workaround... i have posted
regarding the same...



a)导出模板不是一种解决方法,而是它的语言为

正是这个目的。


b)截至今天,只有极少数编译器支持导出。

Best


Kai-Uwe Bux

a) Exporting templates is not a workaround, rather it in the language for
exactly this purpose.

b) As of today, only very few compilers support export.
Best

Kai-Uwe Bux


这篇关于HPP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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