You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not dissimilar to how an application is allowed to override the default global operator new, although the mechanism is a bit different due to the use of link-time overrides rather than compile-time overrides.
This could also potentially be paired with hidden friends to pick up different overrides:
namespacebar {
structX {
operatorsize_t() const;
friendboolfoo::some_func(size_t size) override { /* override implementation */ }
};
}
// This would find X's customisation (since it's an associated entity) and so would consider this an override.// It would be ambiguous which overload to call if the other override declared above was also visible, however.foo::some_func(X{});
This is a pretty obscure edge-case, however.
Maybe it is better to just require that customisable functions are actually templates, at least initially?
The text was updated successfully, but these errors were encountered:
Does it make sense to declare a function as customisable if it does not have any deducible parameter types?
e.g.
such that an application could later provide an override (every override must have that exact signature)
This is not dissimilar to how an application is allowed to override the default global
operator new
, although the mechanism is a bit different due to the use of link-time overrides rather than compile-time overrides.This could also potentially be paired with hidden friends to pick up different overrides:
This is a pretty obscure edge-case, however.
Maybe it is better to just require that customisable functions are actually templates, at least initially?
The text was updated successfully, but these errors were encountered: