<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Apr 20, 2014, at 1:32 PM, Mark Rowe <<a href="mailto:mrowe@apple.com">mrowe@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div><br></div></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">It’s also not possible to determine from context alone whether #if or if should be used. When #if is used to remove members or functions you’re then forced to use #if, rather than if, around all uses of those members or functions since the alternative won’t compile.</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">An example lifted from Vector.h:</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div>#if !ASSERT_DISABLED</div><div>template<typename T> struct ValueCheck<Vector<T>> {</div><div> typedef Vector<T> TraitType;</div><div> static void checkConsistency(const Vector<T>& v)</div><div> {</div><div> v.checkConsistency();</div><div> }</div><div>};</div><div>#endif</div><div><br></div><div><div>template<typename T, size_t inlineCapacity, typename OverflowHandler></div><div>inline void Vector<T, inlineCapacity, OverflowHandler>::checkConsistency()</div><div>{</div><div> if (!ASSERT_DISABLED) {</div><div> for (size_t i = 0; i < size(); ++i)</div><div> ValueCheck<T>::checkConsistency(at(i));</div><div> }</div><div>}</div><div><br></div></div></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">This won’t compile with assertions disabled because ValueCheck::checkConsistency doesn’t exist.</div></blockquote><br></div><div>Oops, I should have read this email before sending my previous reply. It does seem like using if() exclusively to control assertions won’t work.</div><div><br></div><div><br></div><div><div>On Apr 20, 2014, at 2:02 PM, Filip Pizlo <<a href="mailto:fpizlo@apple.com">fpizlo@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="auto"><div>The #if means that the code being guarded isn't indented. I believe that indenting control flow is a good idea. </div></div></blockquote><div><br></div><div>This is the main reason I thought the proposal was promising. Note though that we could change our style guide to call for some indentation of #if’s if we wanted to. It is valid C/C++ to do so. The main is that not all text editors have good support for this. </div><div><br></div><div>Regards,</div><div>Maciej</div></div><div><br></div></body></html>