什么是“翻译单元”在C ++中 [英] What is a "translation unit" in C++

查看:202
本文介绍了什么是“翻译单元”在C ++中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我正在阅读Meyers
编写的Effective C ++,并遇到了翻译单元这个术语。

Hello everybody I am reading at the time the "Effective C++" written by Meyers and came across the term "translation unit".

请给我一个解释:

1)究竟是什么

我应该考虑在使用C ++编程时使用它

2) When should I consider using it when programming with C++

3)如果它只与C ++相关,或者可以与其他编程语言一起使用

3) If it is related only to C++, or it can be used with other programming languages

我可能已经使用它,而不知道术语....

I might already use it without knowing the term....

推荐答案

=http://www.efnetcpp.org/wiki/Translation_unit =nofollow>此处:( wayback machine link

From here: (wayback machine link)


根据标准C ++ 回传机器链接):
翻译单元是编译的基本单元
C ++。它包括
单个源文件的内容,
加上任何头文件的内容
直接或间接包含它,
减去那些被忽略的行
使用条件预处理
语句。

According to standard C++ (wayback machine link) : A translation unit is the basic unit of compilation in C++. It consists of the contents of a single source file, plus the contents of any header files directly or indirectly included by it, minus those lines that were ignored using conditional preprocessing statements.

单个翻译单元可以
编译成一个目标文件,库,
或可执行程序。

A single translation unit can be compiled into an object file, library, or executable program.

翻译单元的概念是在单一定义规则的上下文
中最常提及的

模板。

The notion of a translation unit is most often mentioned in the contexts of the One Definition Rule, and templates.

这篇关于什么是“翻译单元”在C ++中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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