[GiNaC-list] Compiling GiNaC on OS X
Richard B. Kreckel
kreckel at ginac.de
Wed Oct 23 23:53:28 CEST 2013
Hi,
On 10/23/2013 09:42 AM, Stefan Schupp wrote:
> Upon invoking make I get an error regarding an ambiguous conversion in
> multiple lines:
>
> inifcns_nstdsums.cpp:2604:18: error: ambiguous conversion for
> functional-style cast from 'int' to 'lst' (aka 'container<std::list>')
> return e * (-H(lst(0),1/arg).hold());
> ^~~~~
> ./container.h:145:2: note: candidate constructor
> container(STLT const & s, bool discardable = false)
> ^
> ./container.h:167:11: note: candidate constructor
> explicit container(const ex & p1)
>
> All errors are in the above file inifcns_nstdsums.cpp and occur with the
> same cast:
>
> H(lst(0),1/arg).hold()
>
> From the error message I can conclude that there are two constructors
> applyable - which one is the correct one? E.g. casting 0 to ex (changing
> the line to: H(lst( ex(0) ),1/arg).hold() solves the error - is this the
> correct cast or is the other cast the correct one?
According to the manual, the harmonic polylogarithm H expects a general
lst as first argument. So, lst(ex(0)) is correct and lst(int(0)) would
be incorrect.
But I wonder why this clarification is needed. IMHO, the first candidate
shouldn't be considered, if the std::list<T>(T) ctor is explicit, or am
I missing something?
Does the attached patch work for you?
Bye
-richy.
--
Richard B. Kreckel
<http://www.ginac.de/~kreckel/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libcxx-ambiguous-conversion.patch
Type: text/x-patch
Size: 5148 bytes
Desc: not available
URL: <http://www.cebix.net/pipermail/ginac-list/attachments/20131023/dda1f4b2/attachment.patch>
More information about the GiNaC-list
mailing list