This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/19712] New: Can not use pow (as a function), must say std::pow explicitly.


#include <iostream>
#include <cmath>

using namespace std;

double func(double num, double pow)
{
	return(pow(num, pow));
}

int main()
{
	return(0);
}


 error: `pow' cannot be used as a function


If I add std:: before pow, it works:


double func(double num, double pow)
{
	return(std::pow(num, pow));
}

-- 
           Summary: Can not use pow (as a function), must say std::pow
                    explicitly.
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: larsnostdal at gmail dot com
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19712


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]