in C++ ? sure
template<SomeConstraint T>
void F(T p) { ... }
or just void F(SomeConstraint auto p) { ... }
like this for instance: https://gcc.godbolt.org/z/hPM38T