From 1858f24020892cef36653e7b1e8ef753a13d150e Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sun, 20 Jan 2002 18:13:40 +0000 Subject: [PATCH] add old-style "for" scoping workaround by Vesa Karvonen [SVN r12375] --- more/microsoft_vcpp.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/more/microsoft_vcpp.html b/more/microsoft_vcpp.html index 0096fc3e0f..0b589bea23 100644 --- a/more/microsoft_vcpp.html +++ b/more/microsoft_vcpp.html @@ -126,6 +126,17 @@ int main() Workaround: Enclose the offending for loops in another pair of curly braces. +

+Another possible workaround (brought to my attention by Vesa Karvonen) +is this: +

+#ifndef for
+#define for if (0) {} else for
+#endif
+
+ +Note that platform-specific inline functions in included headers might +depend on the old-style for scoping.

[inclass-member-init] In-class member initialization