Skip to content

Commit

Permalink
remove obsolete code
Browse files Browse the repository at this point in the history
Now that `find_object` isn't defined in the header anymore, it doesn't
make sense to fiddle around with dependent names.
  • Loading branch information
sthalik committed Apr 14, 2024
1 parent a63b97f commit c8ae1f8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,7 @@ template<typename T>
std::shared_ptr<T> world::find_object(object_id id)
{
static_assert(std::is_base_of_v<object, T>);
// make it a dependent name so that including "src/object.hpp" isn't needed
using U = std::conditional_t<std::is_same_v<T, object>, T, object>;
if (std::shared_ptr<U> ptr = find_object_(id); !ptr)
if (std::shared_ptr<object> ptr = find_object_(id); !ptr)
return {};
else if constexpr(std::is_same_v<T, object>)
return ptr;
Expand Down

0 comments on commit c8ae1f8

Please sign in to comment.