<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Don't use static_cast with numeric literals"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=131117#c4">Comment # 4</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Don't use static_cast with numeric literals"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=131117">bug 131117</a>
from <span class="vcard"><a class="email" href="mailto:sbergman@redhat.com" title="Stephan Bergmann <sbergman@redhat.com>"> <span class="fn">Stephan Bergmann</span></a>
</span></b>
<pre>(In reply to Mike Kaganski from <a href="show_bug.cgi?id=131117#c3">comment #3</a>)
<span class="quote">> (In reply to Stephan Bergmann from <a href="show_bug.cgi?id=131117#c2">comment #2</a>)
> > Syntactically, functional cast can only be used if
> > wanted_type is a simple-type-specifier (e.g., it cannot be used if
> > wanted_type is "unsigned long").
>
> Works fine for me with unsigned long(9) or unsigned short(9) in VS2019, and
> tested to produce the results of necessary type (e.g. in templated functions
> with deduced params, like std::max)</span >
Retry with a compiler that does not have such a non-standard extension, then.
<span class="quote">> > Apart from that, I at least have no clear
> > preference for either (functional cast is less verbose, though), and am not
> > sure whether such a cosmetic clean-up is worth it and wanted.
>
> I personally dislike seeing those "static_casts" for what is not casting of
> value of one type to another type. I felt it a really easy hack for those
> who might want something very trivial to start. However, I don't mind
> closing this (and I added you to CC to learn your opinion on this).</span >
static_cast<long>(1) /is/ about casting an object of type int to an object of
type long, just as much as long(1) is. I fail to see what to dislike about the
former (apart from its verboseness) but not the latter. I personally would
suggest closing this bug as WONTFIX.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>