Of course, though not through actual inheritance but by simulating it with an implicit conversion:
#include <iostream>
struct MoreDouble
{
operator double() { return 42.5; }
};
void foo(double x)
{
std::cout << x << '\n';
}
int main()
{
MoreDouble md;
foo(md);
}
// Output: 42.5
Whether this is a good idea is another question. I dislike implicit conversions in general so make sure you really need this before using it.