How do you include just one function from a header. Specifically, I want ceil, floor and pow from <cmath>. The is a function being used by it that has the same name as my class
You always include all the functions.
To get around that, in your program don't use usingnamespace std;. You will need to use std::ceil(x) and so on, for all functions and variables in the std namespace. So instead of
1 2 3 4 5 6 7 8
#include<iostream>
usingnamespace std;
int main()
{
cout<<"Hello world"<<endl;
}
you will have
1 2 3 4 5 6
#include<iostream>
int main()
{
std::cout<<"Hello world"<<std::endl;
}
1) Wrap your class in a namespace
2) Investigate the function/class in the library to see if you can use that instead of your class
3) Consider renaming your class