diff --git a/docs/html/standard.htm b/docs/html/standard.htm index 61d507667e..8cb5aab68b 100644 --- a/docs/html/standard.htm +++ b/docs/html/standard.htm @@ -50,6 +50,7 @@ C++ portability guide by David Williams.
A nice side effect is that you don't need to recompile all the files including the header if you change the PrivateLibClass declaration (it's an example of a more general interface/implementation separation idea). + +
+ The ternary operator ?: shouldn't be used with objects (i.e. if any +of its operands are objects) because some compilers (notable Borland C++) fail +to compile such code. +
Workaround: use if/else instead. +
+ wxString s1, s2; + + // Borland C++ won't compile the line below + wxString s = s1.Len() < s2.Len() ? s1 : s2; + + // but any C++ compiler will compile this + wxString s; + if ( s1.Len() < s2.Len() ) + s = s1; + else + s = s2; +