苹果铛版本 [英] Apple clang version
问题描述
我想了解哪个版本的ang苹果安装在我的macbook中,用c ++ 11和/或c ++ 14的功能可以看到。
我键入了此命令:
I want to understand which version of clang Apple installed in my macbook, to see with c++11 and/or c++14 features are available. I typed this command:
clang --version
//----response
Apple LLVM version 7.0.0 (clang-700.1.76)
Target: x86_64-apple-darwin15.0.0
Thread model: posix
但我不能理解(clang-700.1.76)
是什么意思。
如何将此代码转换为clang版本?
But I am not able to understand what (clang-700.1.76)
mean.
How can I convert this code to a clang version?
这是一个可以检查cang版本中可用的c ++功能的网站 http://clang.llvm.org/cxx_status.html
This is the site where you could check c++ features available in clang version http://clang.llvm.org/cxx_status.html
推荐答案
编译器的版本号几乎没有用,因为你还需要考虑你的代码是否用 libstdc ++
或者 libc ++
(或任何其他标准库) - 以及那些版本。
The version number of the compiler is mostly useless, since you also need to consider whether your code is compiled with libstdc++
or with libc++
(or any other standard library) - and which version of those.
如果要测试语言或库功能,更好地检查其他定义的值,例如 __ cplusplus
, __ cpp_constexpr
, __ cpp_variadic_templates
等。这不是完美的,但它似乎工作更好(如果你想要可移植性)在我的经验和所有主要编译器的支持正在改进。
If you want to test for language or library features, it is better to check other defined values, e.g., __cplusplus
, __cpp_constexpr
, __cpp_variadic_templates
, etc. It is not perfect, but it seems to work better (if you want portability) in my experience and the support from all major compiler is improving.
每个C ++标准版本定义 __ cplusplus
的值,一些编译器使用中间值来说我们已经开始在C ++ 14上,但是我们还没有。使用> =
在需要时进行测试。
Each C++ standard version defines a value for __cplusplus
, some compilers use intermediate values to say "we already started on C++14, but we are not there yet". Use >=
to test when needed.
其他功能测试宏类似,版本,网址为 N4440 。不是所有的编译器都实现N4440。
The other feature test macros are similar, you can find the current version at N4440. Not all compilers implement N4440, though.
这篇关于苹果铛版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!