<div dir="ltr"><div>I&#39;m unclear on the issue. Is the problem with an implicit conversion in your code or is there a bug that MSVC ignores the aspect of the standard that should make constant expressions okay in initializer lists? If the latter, explicit casting seems like the right solution.</div><div><br></div>A user-defined literal could be very confusing and hard to document effectively.<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 4, 2017 at 8:15 PM, Schulz, Roland <span dir="ltr">&lt;<a href="mailto:roland.schulz@intel.com" target="_blank">roland.schulz@intel.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You could define a user defined literal _r for real. I think this would be anyhow useful to have.<br>
<div class="HOEnZb"><div class="h5"><br>
-----Original Message-----<br>
From: <a href="mailto:gromacs.org_gmx-developers-bounces@maillist.sys.kth.se">gromacs.org_gmx-developers-<wbr>bounces@maillist.sys.kth.se</a> [mailto:<a href="mailto:gromacs.org_gmx-developers-bounces@maillist.sys.kth.se">gromacs.org_gmx-<wbr>developers-bounces@maillist.<wbr>sys.kth.se</a>] On Behalf Of Vedran Miletic<br>
Sent: Monday, July 3, 2017 6:58 AM<br>
To: GROMACS developers &lt;<a href="mailto:gmx-developers@gromacs.org">gmx-developers@gromacs.org</a>&gt;<br>
Subject: [gmx-developers] MSVC conversion from &#39;double&#39; to &#39;real&#39; requires a narrowing conversion<br>
<br>
Hi,<br>
<br>
I&#39;m hitting MSVC&#39;s conversion from &#39;double&#39; to &#39;real&#39; requires a narrowing conversion error on Jenkins. Is there a workaround that still allows using array initializers?<br>
<br>
I checked Stack Overflow but neither of those solutions is particularly<br>
nice:<br>
*<br>
<a href="https://stackoverflow.com/questions/42491243/conversion-from-double-to-int-requires-a-narrowing-conversion" rel="noreferrer" target="_blank">https://stackoverflow.com/<wbr>questions/42491243/conversion-<wbr>from-double-to-int-requires-a-<wbr>narrowing-conversion</a><br>
*<br>
<a href="https://stackoverflow.com/questions/33605632/error-83-error-c2398-conversion-from-double-to-float-requires-a-narrowing-c" rel="noreferrer" target="_blank">https://stackoverflow.com/<wbr>questions/33605632/error-83-<wbr>error-c2398-conversion-from-<wbr>double-to-float-requires-a-<wbr>narrowing-c</a><br>
<br>
Regards,<br>
Vedran<br>
<br>
--<br>
Vedran Miletić<br>
<a href="http://vedran.miletic.net" rel="noreferrer" target="_blank">vedran.miletic.net</a><br>
--<br>
Gromacs Developers mailing list<br>
<br>
* Please search the archive at <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" rel="noreferrer" target="_blank">http://www.gromacs.org/<wbr>Support/Mailing_Lists/GMX-<wbr>developers_List</a> before posting!<br>
<br>
* Can&#39;t post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" rel="noreferrer" target="_blank">http://www.gromacs.org/<wbr>Support/Mailing_Lists</a><br>
<br>
* For (un)subscribe requests visit<br>
<a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" rel="noreferrer" target="_blank">https://maillist.sys.kth.se/<wbr>mailman/listinfo/gromacs.org_<wbr>gmx-developers</a> or send a mail to <a href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@<wbr>gromacs.org</a>.<br>
--<br>
Gromacs Developers mailing list<br>
<br>
* Please search the archive at <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" rel="noreferrer" target="_blank">http://www.gromacs.org/<wbr>Support/Mailing_Lists/GMX-<wbr>developers_List</a> before posting!<br>
<br>
* Can&#39;t post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" rel="noreferrer" target="_blank">http://www.gromacs.org/<wbr>Support/Mailing_Lists</a><br>
<br>
* For (un)subscribe requests visit<br>
<a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" rel="noreferrer" target="_blank">https://maillist.sys.kth.se/<wbr>mailman/listinfo/gromacs.org_<wbr>gmx-developers</a> or send a mail to <a href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@<wbr>gromacs.org</a>.</div></div></blockquote></div><br></div>