[GiNaC-devel] new tinfos

Jens Vollinga vollinga at physik.uni-wuppertal.de
Mon Nov 21 18:28:56 CET 2005


Hi,

Jens Vollinga wrote:
> I don't know how to solve the problem of namespace collision/ambiguity 
> with built-in function like sin,cos,... yet. But even in the current 
> implementation a get an ambiguity for stuff like
> cout << sin(1) << endl;
> when both cmath and GiNaC are included and all their namespace members 
> are us'ing'ed.

just to fill the void:

1.
We could rename the functions: tan->Tan,... etc.
(I don't like this. It's cowardice.)

2.
We could write some pre-processor definitions like
#define sin GiNaC::sin
...
(Well, maybe. These definition could be packed in a convenience header 
for the user like #include <GiNaC/GiNaC_with_cmath>. But better not to 
include this header multiple times ...)

3.
Don't avoid the ambiguities and force the user to explicitly write the 
namespace for such functions (and make lots of comments about it in the 
manual/tutorial).
(Yes, use the force! Maybe give the user some extra header like in 2. to 
ease the situation).

Regards,
Jens



More information about the GiNaC-devel mailing list