开发者

C++ languages extensions

I already read the FAQ, and i think maybe this is a subjective question, but i need to ask. Does anyine knows what exactly (i mean formally) is a C++ language extensions.

I already saw examples, like nvdia CUDA c ext, Avalon transaction-based c++ ext.

So the point is som开发者_如何学Cething like a formal definition or so.

thxs anyway.


A language extension is simply anything that goes beyond what the language specification calls for. Your compiler might add new features, like special "min" and "max" operators. Your compiler might define the behavior of division by zero, which is otherwise undefined, according to the standard. It might provide additional parameters for your main function. It might be the incorporation of another language's features, such as allowing C-style variable-sized arrays in C++. It might be a facility for specifying a function's calling convention.

Using a language extension usually makes your code non-portable because when you take your code to another OS, compiler, or even compiler version, the extension may not be available anymore, or its behavior may be different from what you had originally used.


Please see Extensible programming:

Extensible programming is a term used in computer science to describe a style of computer programming that focuses on mechanisms to extend the programming language, compiler and runtime environment.

and more to the point, the Extensible syntax section:

This simply means that the source language(s) to be compiled must not be closed, fixed, or static. It must be possible to add new keywords, concepts, and structures to the source language(s).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜