<HTML><BODY>Hello. I have protocol witch allow type to handle it's position and function who handle this position and compiler get me error. Please, tell, Why I can not use protocol name in inout function? The example here.<br><br><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;">protocol</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> Position {</span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;">var</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> x: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #703daa;">Double</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> { </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;">get</span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;">set</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> }</span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">}</span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;">&nbsp;</p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;">struct</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> Car: </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #4f8187;">Position</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> {</span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;">var</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> x: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #703daa;">Double</span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">}</span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;">&nbsp;</p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;">func</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> move(item: </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;">inout&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #4f8187;">Position</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">) {</span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">&nbsp; &nbsp; item.</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #4f8187;">x</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> += </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #272ad8;">1</span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">}</span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;">&nbsp;</p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;">var</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> car = </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #4f8187;">Car</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">(x: </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #272ad8;">50</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">)</span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;">&nbsp;</p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures; color: #31595d;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #31595d;">move</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">(item: &amp;</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #4f8187;">car</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">) \\&nbsp;</span><strong>cannot pass immutable value as inout argument: implicit conversion from 'Car' to 'Position' requires a temporary<br><br></strong></p><br>-- <br>Седых Александр</BODY></HTML>