Skip to content

Commit

Permalink
for gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos committed Jul 12, 2024
1 parent cc7af2f commit 4a351db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/ylt/reflection/member_names.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ inline constexpr std::string_view get_member_name() {
auto split = func_name.substr(0, func_name.size() - 2);
return split.substr(split.find_last_of(":.") + 1);
#elif defined(__GNUC__)
auto split = func_name.substr(0, func_name.size() - 2);
auto split = func_name.substr(0, func_name.rfind(")}"));
return split.substr(split.find_last_of(":") + 1);
#elif defined(_MSC_VER)
auto split = func_name.substr(0, func_name.size() - 7);
Expand Down
2 changes: 1 addition & 1 deletion src/reflection/tests/test_reflection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ TEST_CASE("test member value") {
});

for_each<simple>([](std::string_view field_name) {
std::cout << index << ", " << field_name << "\n";
std::cout << field_name << "\n";
});

constexpr std::string_view name1 = name_of<simple, 2>();
Expand Down

0 comments on commit 4a351db

Please sign in to comment.