Hi, On 6/30/09, fmingu <fmingu@163.com> wrote:
I use Dev-C++,and the snipet of the program is: ............ using namespace std; using namespace boost::lambda; using namespace boost;
void a(){ std::cout<<std::pow(4,3); return; }
I am not an expert but always try to use the using directives "using namespace xxx" as locally as possible. You could have used the using directives inside the function a() inside of dumping all of the namespaces globally. Moreover, may be you can do with std::pow ( 4.0, 3.0 ) to let the compiler see clearly that you are interested in the "double, double" version of pow() instead of the one based on integer arguments. In addition, may be you can enclose your relevant code inside your own namespace then you can typedef the specific overloaded version of the std::pow() function in your namespace to let the compiler resolve pow() call in your favor - to the locally declared pow() in your namespace instead of the other ones in std namespace. Alternatively, you declare and typedef a local pointer to the specific std::pow function in your code and then pass that pointer instead to the function you are interested in calling. -Asif