>>900
ふつーにテンプレートじゃね?
template <typename T> requires std::is_floating_point_v<T>
void func(T&& arg)
{
}

あとanyなんて手もあるけど
void func(std::any arg)
{
if(arg.type() == typeid(double)) { }
if(arg.type() == typeid(float)) { }
}