Using __float128
I try to use __float128
in fvectortest
, see !513 (closed). I cannot get ADL to work for >>
, abs
and sqrt
:
In file included from /temp/bernd/DUNE26/dune-common/dune/common/fvector.hh:20:0,
from /temp/bernd/DUNE26/dune-common/dune/common/test/fvectortest.cc:34:
/temp/bernd/DUNE26/dune-common/dune/common/densevector.hh: In instantiation of ‘typename Dune::FieldTraits< <template-parameter-1-1> >::real_type Dune::fvmeta::absreal(const K&) [with K = __float128; typename Dune::FieldTraits< <template-parameter-1-1> >::real_type = __float128]’:
/temp/bernd/DUNE26/dune-common/dune/common/densevector.hh:603:34: required from ‘typename Dune::FieldTraits<typename Dune::DenseMatVecTraits<V>::value_type>::real_type Dune::DenseVector<V>::one_norm_real() const [with V = Dune::FieldVector<__float128, 3>; typename Dune::FieldTraits<typename Dune::DenseMatVecTraits<V>::value_type>::real_type = __float128]’
/temp/bernd/DUNE26/dune-common/dune/common/test/fvectortest.cc:84:7: required from ‘FieldVectorMainTestCommons<ft, rt, d>::FieldVectorMainTestCommons() [with ft = __float128; rt = __float128; int d = 3]’
/temp/bernd/DUNE26/dune-common/dune/common/test/fvectortest.cc:152:43: required from ‘FieldVectorMainTest<ft, rt, d, false>::FieldVectorMainTest() [with ft = __float128; rt = __float128; int d = 3]’
/temp/bernd/DUNE26/dune-common/dune/common/test/fvectortest.cc:398:5: required from ‘FieldVectorTest<ft, d, false>::FieldVectorTest() [with ft = __float128; int d = 3]’
/temp/bernd/DUNE26/dune-common/dune/common/test/fvectortest.cc:565:36: required from here
/temp/bernd/DUNE26/dune-common/dune/common/densevector.hh:47:17: error: call of overloaded ‘abs(const __float128&)’ is ambiguous
return abs(k);
~~~^~~
In file included from /usr/include/c++/7/cmath:47:0,
from /usr/include/c++/7/complex:44,
from /temp/bernd/DUNE26/dune-common/dune/common/test/fvectortest.cc:8:
/usr/include/c++/7/bits/std_abs.h:78:3: note: candidate: constexpr long double std::abs(long double)
abs(long double __x)
^~~
/usr/include/c++/7/bits/std_abs.h:74:3: note: candidate: constexpr float std::abs(float)
abs(float __x)
^~~
/usr/include/c++/7/bits/std_abs.h:70:3: note: candidate: constexpr double std::abs(double)
abs(double __x)
^~~
/usr/include/c++/7/bits/std_abs.h:61:3: note: candidate: long long int std::abs(long long int)
abs(long long __x) { return __builtin_llabs (__x); }
^~~
/usr/include/c++/7/bits/std_abs.h:56:3: note: candidate: long int std::abs(long int)
abs(long __i) { return __builtin_labs(__i); }
^~~
It works only if I place the definitions of >>
, abs
and sqrt
inside namespace std
. Which I'm not supposed to do, right?
Edited by Bernd Flemisch