Skip to content

Commit 4b15ba5

Browse files
committed
Clang couldn't deduce template argument on macOS
1 parent 66e8819 commit 4b15ba5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

samples/star_wars/DroidData.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ void Droid::addFriends(
3232
[](const auto& spFriend) noexcept {
3333
return std::visit(
3434
[](const auto& hero) noexcept {
35-
return WeakHero { std::weak_ptr { hero } };
35+
return WeakHero { std::weak_ptr<std::decay_t<decltype(hero)>::element_type> {
36+
hero } };
3637
},
3738
spFriend);
3839
});

samples/star_wars/HumanData.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ void Human::addFriends(std::vector<SharedHero> friends) noexcept
3131
[](const auto& spFriend) noexcept {
3232
return std::visit(
3333
[](const auto& hero) noexcept {
34-
return WeakHero { std::weak_ptr { hero } };
34+
return WeakHero { std::weak_ptr<std::decay_t<decltype(hero)>::element_type> {
35+
hero } };
3536
},
3637
spFriend);
3738
});

0 commit comments

Comments
 (0)