Hi Vladimir, On 07/08/2016 10:28 AM, Vladimir V. Kisil wrote:
I am trying to compile the following code:
#include <ginac/ginac.h> using namespace GiNaC; using namespace std; int main () { symbol x("x"); ex a=exp(x); cout << is_a<symbol>(x) << endl; cout << is_a<function>(a) << endl; }
If a compiler option -std=gnu++11 is used, I got errors like this:
test-g.cpp:9:26: error: no matching function for call to 'is_a(GiNaC::ex&)' cout << is_a<function>(a) << endl;
(see the full log at the end of my message). Compiler complains about is_a<symbol> but is happy with is_a<function>(a).
The code can be compiled and run well if -std=gnu++11 is omitted.
Any suggestions?
Sigh. Your using directives cause a name clash about std::function (new since C++11) and good old class GiNaC::function: <http://en.cppreference.com/w/cpp/utility/functional/function>. I recommend that you disambiguate manually. All my best, -richy. -- Richard B. Kreckel <http://in.terlu.de/~kreckel/>