<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">I don’t know how C API is imported, btus INOUT parameter must be mutable, this is a language artifact.</div> <br> <div id="bloop_sign_1516137408329259008" class="bloop_sign"></div> <br><p class="airmail_on">Am 16. Januar 2018 um 22:10:13, Rick Mann via swift-users (<a href="mailto:swift-users@swift.org">swift-users@swift.org</a>) schrieb:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>Is it not possible for Swift to treat C API const pointers as something that can take let arguments?<br><br><br>LGS_EXPORT bool lgs_notify(struct lgs_context_t* ctx, const lgs_notify_params_t* params);<br>.<br>.<br>.<br>let p = lgs_notify_params_t(...)<br>lgs_notify(self.ctx, &p)<br> ^Cannot pass immutable value as inout argument: 'p' is a 'let' constant<br><br><br>Why isn't the "const" in the C declaration enough to let Swift know it's const and just allow it to be a let?<br><br>-- <br>Rick Mann<br>rmann@latencyzero.com<br><br><br>_______________________________________________<br>swift-users mailing list<br>swift-users@swift.org<br>https://lists.swift.org/mailman/listinfo/swift-users<br></div></div></span></blockquote></body></html>