This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

STL & template bug &


// 
//  I'm sorry to send you 3 times the same message but
//  there is something wrong in the transmission
//  I cannot see template "<class T>" in my previous messages
//  I hope that this time it will work
//  of course, without -DTEMPLATE the source code compiles
//

//
// gcc version egcs-2.90.14 971023 (gcc2-970802 experimental)
//
// with -DTEMPLATE the compiler does not compile
//

#include <vector.h>
#include <algo.h>

template <class T> class Expr 
{
public :
Expr(){};
Expr(const T&){};
};

#ifdef TEMPLATE
template <class T >
inline bool compare(const Expr<T> a, const Expr<T> b){ return true; };
#else
inline bool compare(const Expr<int> a, const Expr<int> b){ return true; };
#endif

void main()
{
vector<int>	a(3);
sort( a.begin(), a.end(), compare );
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]