Blender V5.0
NOD_menu_value.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
7#include "BLI_hash.hh"
9
10namespace blender::nodes {
11
16struct MenuValue {
17 int value = 0;
18
19 MenuValue() = default;
20 explicit MenuValue(const int value) : value(value) {}
21
22 template<typename EnumT, BLI_ENABLE_IF((std::is_enum_v<EnumT>))>
23 MenuValue(const EnumT value) : value(int(value))
24 {
25 }
26
27 uint64_t hash() const
28 {
29 return get_default_hash(this->value);
30 }
31
33};
34
35} // namespace blender::nodes
#define BLI_STRUCT_EQUALITY_OPERATORS_1(Type, m)
unsigned long long int uint64_t
uint64_t get_default_hash(const T &v, const Args &...args)
Definition BLI_hash.hh:233
MenuValue(const EnumT value)