1
0
Fork 0
mirror of https://github.com/Neargye/magic_enum.git synced 2026-01-10 23:44:29 +00:00

clean-up & improve (#170)

This commit is contained in:
Daniil Goncharov 2022-03-28 18:56:16 +04:00 committed by GitHub
parent cee99df7b5
commit 2e7313d3f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 209 additions and 179 deletions

View file

@ -1,6 +1,6 @@
// Licensed under the MIT License <http://opensource.org/licenses/MIT>.
// SPDX-License-Identifier: MIT
// Copyright (c) 2019 - 2021 Daniil Goncharov <neargye@gmail.com>.
// Copyright (c) 2019 - 2022 Daniil Goncharov <neargye@gmail.com>.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -1039,12 +1039,12 @@ TEST_CASE("cmp_less") {
}
}
template<Color C>
template <Color C>
constexpr std::string_view DoWork() {
return "default";
}
template<>
template <>
constexpr std::string_view DoWork<Color::GREEN>() {
return "override";
}
@ -1086,11 +1086,11 @@ TEST_CASE("enum_for_each") {
constexpr auto colorInts = enum_for_each<Color>([](auto val) {
return val;
});
REQUIRE(std::is_same_v<std::remove_const_t<decltype(colorInts)>, std::tuple<
std::integral_constant<Color, Color::RED>,
std::integral_constant<Color, Color::GREEN>,
std::integral_constant<Color, Color::BLUE>
>>);
REQUIRE(std::is_same_v<std::remove_const_t<decltype(colorInts)>,
std::tuple<enum_constant<Color::RED>,
enum_constant<Color::GREEN>,
enum_constant<Color::BLUE>>>);
}
}

View file

@ -1,6 +1,6 @@
// Licensed under the MIT License <http://opensource.org/licenses/MIT>.
// SPDX-License-Identifier: MIT
// Copyright (c) 2019 - 2021 Daniil Goncharov <neargye@gmail.com>.
// Copyright (c) 2019 - 2022 Daniil Goncharov <neargye@gmail.com>.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal