Changeset View
Changeset View
Standalone View
Standalone View
kstars/kstarsenum.h
- This file was added.
1 | /*************************************************************************** | ||||
---|---|---|---|---|---|
2 | kstarsenum.h - K Desktop Planetarium | ||||
3 | ------------------- | ||||
4 | begin : Tue Jun 12 19:26:33 GMT+3 | ||||
5 | copyright : (C) 2018 by Csaba Kertesz | ||||
6 | email : csaba.kertesz@gmail.com | ||||
7 | ***************************************************************************/ | ||||
8 | /*************************************************************************** | ||||
9 | * * | ||||
10 | * This program is free software; you can redistribute it and/or modify * | ||||
11 | * it under the terms of the GNU General Public License as published by * | ||||
12 | * the Free Software Foundation; either version 2 of the License, or * | ||||
13 | * (at your option) any later version. * | ||||
14 | * * | ||||
15 | ***************************************************************************/ | ||||
16 | | ||||
17 | #pragma once | ||||
18 | | ||||
19 | #include <type_traits> | ||||
20 | | ||||
21 | namespace KStarsEnum | ||||
22 | { | ||||
23 | template <typename E> | ||||
24 | constexpr auto toType(E e) -> typename std::underlying_type<E>::type | ||||
25 | { | ||||
26 | return static_cast<typename std::underlying_type<E>::type>(e); | ||||
27 | } | ||||
28 | } | ||||
29 | No newline at end of file |