summaryrefslogtreecommitdiff
path: root/libs/config/test/boost_no_range_based_for.ipp
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2013-08-26 08:15:55 -0400
committerAnas Nashif <anas.nashif@intel.com>2013-08-26 08:15:55 -0400
commitbb4dd8289b351fae6b55e303f189127a394a1edd (patch)
tree77c9c35a31b1459dd7988c2448e797d142530c41 /libs/config/test/boost_no_range_based_for.ipp
parent1a78a62555be32868418fe52f8e330c9d0f95d5a (diff)
downloadboost-bb4dd8289b351fae6b55e303f189127a394a1edd.tar.gz
boost-bb4dd8289b351fae6b55e303f189127a394a1edd.tar.bz2
boost-bb4dd8289b351fae6b55e303f189127a394a1edd.zip
Imported Upstream version 1.51.0upstream/1.51.0
Diffstat (limited to 'libs/config/test/boost_no_range_based_for.ipp')
-rw-r--r--libs/config/test/boost_no_range_based_for.ipp23
1 files changed, 23 insertions, 0 deletions
diff --git a/libs/config/test/boost_no_range_based_for.ipp b/libs/config/test/boost_no_range_based_for.ipp
new file mode 100644
index 0000000000..15468ec462
--- /dev/null
+++ b/libs/config/test/boost_no_range_based_for.ipp
@@ -0,0 +1,23 @@
+// Copyright Beman Dawes 2012
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// See http://www.boost.org/libs/config for more information.
+
+// MACRO: BOOST_NO_CXX11_RANGE_BASED_FOR
+// TITLE: C++11 ranged-based for statement unavailable
+// DESCRIPTION: The compiler does not support the C++11 range-based for statement
+
+namespace boost_no_cxx11_range_based_for {
+
+int test()
+{
+ // example from 6.5.4 The range-based for statement [stmt.ranged]
+ int array[5] = { 1, 2, 3, 4, 5 };
+ for (int& x : array)
+ x *= 2;
+ return 0;
+}
+
+}