Skip to content

Commit 81282ef

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 3b84393 + 5b6e12f commit 81282ef

File tree

13 files changed

+33
-38
lines changed

13 files changed

+33
-38
lines changed

.github/workflows/bzlmod-archive.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
permissions:
1313
contents: write
1414
steps:
15-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
15+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1616
- run: git archive -o "${{ format('{0}-{1}.tar.gz', github.event.repository.name, github.event.release.tag_name) }}" HEAD
1717
- run: gh release upload ${{ github.event.release.tag_name }} *.tar.gz
1818
env:

.github/workflows/macos.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
config:
14-
- { os: macos-13 }
1514
- { os: macos-14 }
1615
- { os: macos-15 }
1716

1817
name: "${{ matrix.config.os }}"
1918
steps:
20-
- uses: actions/checkout@v5
19+
- uses: actions/checkout@v6
2120

2221
- name: Build Release
2322
run: |

.github/workflows/scorecard.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
steps:
2727
- name: "Checkout code"
28-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
28+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2929
with:
3030
persist-credentials: false
3131

@@ -47,14 +47,14 @@ jobs:
4747
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
4848
# format to the repository Actions tab.
4949
- name: "Upload artifact"
50-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
50+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
5151
with:
5252
name: SARIF file
5353
path: results.sarif
5454
retention-days: 5
5555

5656
# Upload the results to GitHub's code scanning dashboard.
5757
- name: "Upload to code-scanning"
58-
uses: github/codeql-action/upload-sarif@0499de31b99561a6d14a36a5f662c2a54f91beee # v3.29.5
58+
uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v3.29.5
5959
with:
6060
sarif_file: results.sarif

.github/workflows/ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
name: "${{ format('{0} NONASCII={1}', matrix.compiler.cc, matrix.compiler.nonascii) }}"
2626
runs-on: ${{ matrix.compiler.os }}
2727
steps:
28-
- uses: actions/checkout@v5
28+
- uses: actions/checkout@v6
2929

3030
- name: Configure clang
3131
run: |

.github/workflows/ubuntu_test_installed_version.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
runs-on: ubuntu-latest
2121

2222
steps:
23-
- uses: actions/checkout@v5
23+
- uses: actions/checkout@v6
2424

25-
- uses: actions/cache@v4
25+
- uses: actions/cache@v5
2626
with:
2727
path: "**/cpm_modules"
2828
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}

.github/workflows/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
name: "${{ matrix.config.vs }}"
1818
steps:
19-
- uses: actions/checkout@v5
19+
- uses: actions/checkout@v6
2020

2121
- name: Build Win32
2222
shell: bash

BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
load("@rules_cc//cc:defs.bzl", "cc_library")
2+
13
licenses(["notice"])
24

35
exports_files(["LICENSE"])

MODULE.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ module(
33
version = "0.9.7",
44
compatibility_level = 0,
55
)
6+
7+
bazel_dep(name = "rules_cc", version = "0.2.14")

doc/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ constexpr array<pair<E, string_view>, N> enum_entries() noexcept;
282282

283283
```cpp
284284
namespace customize {
285-
template <typename E,typename = void>
285+
template <typename E, typename = void>
286286
struct enum_range {
287287
constexpr static std::size_t prefix_length = 0;
288288
constexpr static bool is_flags = false;

include/magic_enum/magic_enum.hpp

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ namespace customize {
177177
}
178178

179179
namespace detail {
180-
template<typename E,typename = void>
180+
template<typename E, typename = void>
181181
constexpr inline std::size_t prefix_length_or_zero = 0;
182182

183183
template<typename E>
@@ -190,25 +190,25 @@ template <bool IsFlags = false, int Min = MAGIC_ENUM_RANGE_MIN, int Max = MAGIC_
190190
struct adl_info_holder {
191191
constexpr static int max = Max;
192192
constexpr static int min = Min;
193-
constexpr static bool is_flags =IsFlags;
193+
constexpr static bool is_flags = IsFlags;
194194
constexpr static std::size_t prefix_length = PrefixLength;
195195

196-
template<int min,int max>
197-
constexpr static adl_info_holder<IsFlags,min,max,PrefixLength> minmax() { return {}; }
196+
template<int min, int max>
197+
constexpr static adl_info_holder<IsFlags, min, max, PrefixLength> minmax() { return {}; }
198198

199199
template<bool is_flag>
200-
constexpr static adl_info_holder<is_flag,Min,Max,PrefixLength> flag() { return {}; }
200+
constexpr static adl_info_holder<is_flag, Min, Max, PrefixLength> flag() { return {}; }
201201

202202
template<std::size_t prefix_len>
203-
constexpr static adl_info_holder<IsFlags,Min,Max,prefix_len> prefix() { return {}; }
203+
constexpr static adl_info_holder<IsFlags, Min, Max, prefix_len> prefix() { return {}; }
204204
};
205205

206206
constexpr adl_info_holder<> adl_info() { return {}; }
207207

208208
// Enum value must be in range [MAGIC_ENUM_RANGE_MIN, MAGIC_ENUM_RANGE_MAX]. By default MAGIC_ENUM_RANGE_MIN = -128, MAGIC_ENUM_RANGE_MAX = 127.
209209
// If need another range for all enum types by default, redefine the macro MAGIC_ENUM_RANGE_MIN and MAGIC_ENUM_RANGE_MAX.
210210
// If need another range for specific enum type, add specialization enum_range for necessary enum type.
211-
template <typename E,typename /*= void*/>
211+
template <typename E, typename>
212212
struct enum_range {
213213
static constexpr int min = MAGIC_ENUM_RANGE_MIN;
214214
static constexpr int max = MAGIC_ENUM_RANGE_MAX;
@@ -261,7 +261,7 @@ namespace detail {
261261

262262
template <typename T>
263263
struct supported
264-
#if defined(MAGIC_ENUM_SUPPORTED) && MAGIC_ENUM_SUPPORTED || defined(MAGIC_ENUM_NO_CHECK_SUPPORT)
264+
#if defined(MAGIC_ENUM_SUPPORTED) || defined(MAGIC_ENUM_NO_CHECK_SUPPORT)
265265
: std::true_type {};
266266
#else
267267
: std::false_type {};
@@ -840,22 +840,7 @@ constexpr enum_subtype subtype(std::true_type) noexcept {
840840
} else if constexpr (has_is_flags<E>::value) {
841841
return customize::enum_range<E>::is_flags ? enum_subtype::flags : enum_subtype::common;
842842
} else {
843-
#if defined(MAGIC_ENUM_AUTO_IS_FLAGS)
844-
constexpr auto flags_values = values<E, enum_subtype::flags>();
845-
constexpr auto default_values = values<E, enum_subtype::common>();
846-
if (flags_values.size() == 0 || default_values.size() > flags_values.size()) {
847-
return enum_subtype::common;
848-
}
849-
for (std::size_t i = 0; i < default_values.size(); ++i) {
850-
const auto v = static_cast<U>(default_values[i]);
851-
if (v != 0 && (v & (v - 1)) != 0) {
852-
return enum_subtype::common;
853-
}
854-
}
855-
return enum_subtype::flags;
856-
#else
857843
return enum_subtype::common;
858-
#endif
859844
}
860845
}
861846

@@ -1503,8 +1488,8 @@ template <detail::enum_subtype S, typename E>
15031488
template <bool AsFlags = true>
15041489
inline constexpr auto as_flags = AsFlags ? detail::enum_subtype::flags : detail::enum_subtype::common;
15051490

1506-
template <bool AsFlags = true>
1507-
inline constexpr auto as_common = AsFlags ? detail::enum_subtype::common : detail::enum_subtype::flags;
1491+
template <bool AsCommon = true>
1492+
inline constexpr auto as_common = AsCommon ? detail::enum_subtype::common : detail::enum_subtype::flags;
15081493

15091494
namespace bitwise_operators {
15101495

0 commit comments

Comments
 (0)