aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/utility.h
blob: 27de88d3398786d95b6f19e4e610c2d76b0f66f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

namespace Utils {

template<typename Enumeration>
[[nodiscard]] constexpr std::underlying_type_t<Enumeration> to_underlying(Enumeration enumeration) noexcept
{
    return static_cast<std::underlying_type_t<Enumeration>>(enumeration);
}

} // namespace Utils