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
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Re: XLC Port: Part II - External definition of a template member function of a template class causing the problems?
- From: Aron Ahmadia <aja2111@xxxxxxxxxxxx>
- Date: Sat, 30 Jan 2010 17:18:38 +0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=UE+pnbfpKtcFSI9GZlJhC79g7+FNNAukWFSCqTkSM3c=; b=rJa5qPThpJCUi8DNDO9mzcBcK+8Dwq5lLkMN33wK9GaqhF+JFAbHcJTa+zCNMEK3vm kO5GT0N10nqoksGfb1GdGT5yg2W9X7g+SIdfKvnkYtOu59MGFtkQPrIM6xytuzdVFt7J IBPwMUB6Kq26gdStRIEIP8SlFPk0Og2k8NKFs=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=XHzmlzgQ66l0EghK/5gje5/S/mIZNSCk0rLEU6ozgHgjrDgMxbrGq4tCApYbBbiB1v BDAJizhjNvZMBzSzxuaNw0RZOdJmIOy2NblpSLvdUMwKRWl+QUqKhdOMk9rgsRsyhBZ+ VHvoFvHQLNwok02aDbhSWwFmQAAnl3iRBGBRQ=
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
>