These are chat archives for bluescarni/piranha

22nd
Jul 2016
Srajan Garg
@srajangarg
Jul 22 2016 06:32
@bluescarni Is piranha::rational not constructible from piranha::integer? The reason I'm asking is func({{0, 1_z}}) fails, where the func signature is func(std::map<uint, piranha::rational>) and 1_z is piranha::integer(1)
 no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::map<unsigned int, piranha::mp_rational<> >&&’
Francesco Biscani
@bluescarni
Jul 22 2016 08:27
@srajangarg there is no implicit constructor of rational from integer
I think that the use of integer in the initializer list {{0,1_z}} invokes some kind of implicit conversion of integer to rational
maybe you can workaround that behaviour by constructing an empty map and then inserting a new element?
Francesco Biscani
@bluescarni
Jul 22 2016 08:40
std::map<uint, piranha::rational> tmp;
tmp.emplace(0,1_z);
func(tmp);
something like that
Srajan Garg
@srajangarg
Jul 22 2016 15:07
No, the point is the ease of writing it like that. One work around is just doing {{0, rational_class(1_z)}}. Is there no other way for it to work? It works for our gmp and flint wrappers.