[Libreoffice-commits] core.git: Branch 'feature/priorities' - include/vcl vcl/source

Tobias Madl tobias.madl.dev at gmail.com
Thu Jan 22 01:58:13 PST 2015


So i replaced it with a static cast now :)

But i don't get the thing with changing it to a C++11 enum class. It is
already an enum class ????

Cheers

Tobi

On Thu, Jan 22, 2015 at 10:41 AM, Miklos Vajna <vmiklos at collabora.co.uk>
wrote:

> Hi Tobias,
>
> [ Taking back the discussion to the list, so Noel and others can jump
> in. ]
>
> On Thu, Jan 22, 2015 at 10:20:59AM +0100, Tobias Madl <
> tobias.madl.dev at gmail.com> wrote:
> > Replacing sounds good, but i have to change it in every single file, that
> > uses them, so there is the question if this work is really that
> usefull....
> > (but if you prefer to replace it i will do :)
>
> If you change IdlePriority to a C++11 enum class, you have to adjust all
> the clients anyway. *If* you do that, then removing the now redundant
> prefix makes sense, I would say.
>
> > I had the same idea with the static cast, but last time i wanted to use
> one
> > noel said no ^^ So is it ok, or not?
>
> static_cast<> is not always safe (that's difference between
> dynamic_cast<> and static_cast<>), but static_casting an enum class to
> an int value is always safe, AFAIK. I would certainly choose that if it
> helps avoiding repeating yourself, which is the case here.
>
> Regards,
>
> Miklos
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20150122/768a1385/attachment.html>


More information about the LibreOffice mailing list