samedi 3 décembre 2022

Dynamic return type in c++

I have a requirement in which I want to make a program in c++ which will be having a function that accept 2 numbers as parameter and return value with high precision using templates.

For Ex - if func(T x, U y) if x and y is passed and x is of int type and y is of float then it should return y.

Here I am not able to get how to make the dynamic return type and how we can determine the number with high precision.

Aucun commentaire:

Enregistrer un commentaire