Helios Engine
A modular ECS based data-oriented C++23 game engine framework
Loading...
Searching...
No Matches
helios::utils::PolymorphicConvertible Concept Reference

Concept to allow argument conversion with polymorphic relationships. More...

#include <common_traits.hpp>

Concept definition

template<typename From, typename To>
std::convertible_to<From, To> ||
(std::is_polymorphic_v<std::remove_reference_t<From>> &&
std::is_polymorphic_v<std::remove_reference_t<To>> &&
(std::derived_from<std::remove_cvref_t<From>, std::remove_cvref_t<To>> ||
std::derived_from<std::remove_cvref_t<To>, std::remove_cvref_t<From>>))
Concept to allow argument conversion with polymorphic relationships.

Detailed Description

Concept to allow argument conversion with polymorphic relationships.

Allows regular convertibility or base/derived relationship for polymorphic types. This is useful for type-erased containers and delegates to provide flexible argument handling.

The concept is satisfied when:

  • From is convertible to To (standard conversion), OR
  • Both From and To are polymorphic types and one derives from the other
Template Parameters
FromSource type.
ToTarget type.

Definition at line 71 of file common_traits.hpp.