-
Notifications
You must be signed in to change notification settings - Fork 0
Description
The current hasSignature() check is too strict when verifying if a method supports a given signature.
Example:
setAnimalName->hasSignature< std::string& >() → true
setAnimalName->hasSignature< std::string >() → false
This result is misleading. From a caller’s perspective, setAnimalName can clearly be invoked with either form — RTL will perfect-forward the argument correctly to the function.
The purpose of hasSignature< T >() is to allow users to safely verify that a method can be called with a given type. For that, it should abstract away the following equivalent forms:
T&
const T&
const T
T&&
In practice, if the call-site can compile in C++ with such an argument, hasSignature< T >() should return true.
Expected Behavior:
hasSignature< std::string >() should return true for a method declared as void setAnimalName(std::string&).
Rationale:
RTL’s responsibility is to ensure that user-provided arguments reach the final call-site as intended. Signature checks should reflect callability, not exact type qualifiers.