hkmoffat / cantera

Automatically exported from code.google.com/p/cantera
0 stars 0 forks source link

Calling the overloaded operators log and exp is ambiguous in RxnRates.h #136

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Build cantera
2. Include some cantera kinetics header files into an application with own 
implementations of log and exp, e.g. OpenFOAM
3. Build the application

Gives for example:
error: call of overloaded ‘log(doublereal&)’ is ambiguous

Using cantera 2.0.1, OpenFOAM 2.1.x, gcc 4.7.2 on linux 3.6.11-1-ARCH.

Adding a std namespace should fix it...Or does cantera 2.0 use own 
implementations of log/exp?

Original issue reported on code.google.com by hbon...@googlemail.com on 8 Jan 2013 at 6:12

GoogleCodeExporter commented 9 years ago
Cantera is using these functions from the math.h header (included by way of 
<cmath>). Arguably OpenFOAM shouldn't be defining functions with these names in 
the global namespace, but it wouldn't hurt for Cantera to be more explicit and 
specify std::log and std::exp.

Original comment by yarmond on 8 Jan 2013 at 7:29

GoogleCodeExporter commented 9 years ago
I think this should be fixed by the changes in r2121. Please update this report 
if there are any other places where these changes need to be made.

Original comment by yarmond on 7 Feb 2013 at 11:43

GoogleCodeExporter commented 9 years ago

Original comment by yarmond on 3 Mar 2013 at 1:44