| Re: [eigen] unpleasant surprise mit math functions | 
[ Thread Index | 
Date Index
| More lists.tuxfamily.org/eigen Archives
] 
On 22.09.2012 22:21, Gael Guennebaud wrote:
there is indeed something very strange happening. I've no idea why
sin(t) with t a VectorXd does compile. It seems it manages to directly
found Eigen::internal::sin even though VectorXd is defined in the
Eigen namespace, not Eigen::internal. [...]
I guess the reason is that Eigen::Matrix has some base classes in 
Eigen::internal. I modified your example accordingly:
namespace A {
  namespace internal {
    template<typename T> T bar(const T& x) { return x; }
    struct Base {};
  }
  struct Matrix : public internal::Base { float x; };
}
int main()
{
  A::Matrix m;
  bar(m); // does compile!
}
// EOE
Christoph
--
----------------------------------------------
Dipl.-Inf. Christoph Hertzberg
Cartesium 0.049
Universität Bremen
Enrique-Schmidt-Straße 5
28359 Bremen
Tel: +49 (421) 218-64252
----------------------------------------------