<div dir="ltr">import std.traits : fqn = fullyQualifiedName;</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 30, 2017 at 12:24 PM, Biotronic via Digitalmars-d-learn <span dir="ltr"><<a href="mailto:digitalmars-d-learn@puremagic.com" target="_blank">digitalmars-d-learn@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tuesday, 30 May 2017 at 10:09:50 UTC, Andrew Edwards wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
What does that even mean?<br>
<br>
Scenario:<br>
<br>
bool func(const ImVec2 label_size)<br>
{<br>
return true;<br>
}<br>
<br>
void main()<br>
{<br>
//first attempt:<br>
const ImVec2 label_size = CalcTextSize(label.ptr, null, true);<br>
//Error: cannot implicitly convert expression (CalcTextSize(cast(immutable(c<wbr>har)*)label, null, true, -1F)) of type ImVec2 to const(ImVec2)<br>
<br>
//second attempt<br>
const ImVec2 label_size = cast(const)CalcTextSize(label.<wbr>ptr, null, true);<br>
// Error: cannot implicitly convert expression (CalcTextSize(cast(immutable(c<wbr>har)*)label, null, true, -1F)) of type const(ImVec2) to const(ImVec2)<br>
<br>
//third attempt<br>
const auto label_size = CalcTextSize(label.ptr, null, true);<br>
//Okay: don't know why the other two didn't work but I can keep going for now<br>
<br>
func(label_size);<br>
//Error: function imgui_d.func (const(ImVec2) label_size) is not callable using argument types (const(ImVec2))<br>
}<br>
</blockquote>
<br></div></div>
My immediate thought is 'is that the same ImVec2?' Do you have two definitions of ImVec2 laying about?<br>
<br>
What's the output of this code, if you insert it somewhere in the above?<br>
<br>
import std.traits;<br>
<br>
pragma(msg, fqn!ImVec2);<br>
pragma(msg, fqn!(typeof(CalcTextSize(label<wbr>.ptr, null,<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
true))));<br>
</blockquote>
<br>
--<br>
Biotronic<br>
</blockquote></div><br></div>