Re: [eigen] Re: XLC Port: Part II - External definition of a template member function of a template class causing the problems?

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


This works:
aron@fen1:~/scratch% xlC -o bad_xlc2 bad_xlc2.cxx -I eigen/ -I
eigen/Eigen

       [0]
aron@fen1:~/scratch% ./bad_xlc2


[0]
generic
Foo

> Try this:
>
> #include<iostream>
>
> template<typename T> struct ei_traits
> {
>  ei_traits() { std::cout<< "generic" <<std::endl; }
> };
>
> template<typename T, typename U> struct Foo
> {};
>
> template<typename T, typename U>
> struct ei_traits<Foo<T,U> >
> {
>  ei_traits() { std::cout<< "Foo" <<std::endl; }
> };
>
> int main()
> {
>  ei_traits<int> a;
>  ei_traits<Foo<int,float> > b;
> }
>
> Benoit
>



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/