Features: Add cxx_range_for.
This commit is contained in:
parent
0fa9bbf1fa
commit
735adf2c94
@ -82,6 +82,11 @@ The features known to this version of CMake are:
|
|||||||
|
|
||||||
.. _N2928: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm
|
.. _N2928: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm
|
||||||
|
|
||||||
|
``cxx_range_for``
|
||||||
|
Range-based for, as defined in N2930_.
|
||||||
|
|
||||||
|
.. _N2930: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html
|
||||||
|
|
||||||
``cxx_static_assert``
|
``cxx_static_assert``
|
||||||
Static assert, as defined in N1720_.
|
Static assert, as defined in N1720_.
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ set(_cmake_feature_test_cxx_override "${GNU47_CXX11}")
|
|||||||
set(GNU46_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
|
set(GNU46_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
|
||||||
set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}")
|
set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}")
|
||||||
set(_cmake_feature_test_cxx_nullptr "${GNU46_CXX11}")
|
set(_cmake_feature_test_cxx_nullptr "${GNU46_CXX11}")
|
||||||
|
set(_cmake_feature_test_cxx_range_for "${GNU46_CXX11}")
|
||||||
# TODO: Should be supported by GNU 4.5
|
# TODO: Should be supported by GNU 4.5
|
||||||
set(GNU45_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
|
set(GNU45_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
|
||||||
set(_cmake_feature_test_cxx_explicit_conversions "${GNU45_CXX11}")
|
set(_cmake_feature_test_cxx_explicit_conversions "${GNU45_CXX11}")
|
||||||
|
@ -56,6 +56,7 @@
|
|||||||
F(cxx_nonstatic_member_init) \
|
F(cxx_nonstatic_member_init) \
|
||||||
F(cxx_nullptr) \
|
F(cxx_nullptr) \
|
||||||
F(cxx_override) \
|
F(cxx_override) \
|
||||||
|
F(cxx_range_for) \
|
||||||
F(cxx_static_assert) \
|
F(cxx_static_assert) \
|
||||||
F(cxx_strong_enums) \
|
F(cxx_strong_enums) \
|
||||||
F(cxx_trailing_return_types) \
|
F(cxx_trailing_return_types) \
|
||||||
|
10
Tests/CompileFeatures/cxx_range_for.cpp
Normal file
10
Tests/CompileFeatures/cxx_range_for.cpp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
void someFunc()
|
||||||
|
{
|
||||||
|
int accumulated = 0;
|
||||||
|
int numbers[] = { 1, 2, 5 };
|
||||||
|
for (int i : numbers)
|
||||||
|
{
|
||||||
|
accumulated += i;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user