<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 11, 2017, at 12:12 PM, Edward Connell via swift-users <<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: Alegreya-Regular; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">It seems that an easy workaround would be an #include statement. </div><div style="font-family: Alegreya-Regular; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">The boiler plate can be put in a separate file and included wherever it's needed. </div></div></blockquote></div><br class=""><div class="">IMHO this seems like a surefire ‘design smell’ — if you have a use case where you find yourself wanting a preprocessor to eliminate lots of redundant lines in your source code, then either your code or the language you’re using have serious problems.</div><div class=""><br class=""></div><div class="">(I see absolutely nothing wrong with inheritance, and it solves exactly this sort of problem. Yes, structs can’t inherit, but they can contain a common struct as a member, which is quite similar and addresses this issue.)</div><div class=""><br class=""></div><div class="">—Jens</div></body></html>