set of class

hello,
i have a problem with set.
the problem is not the declarartion:
1
2
3
set<TS> sec_ts;
TS* t=new TS(w);
sec_ts.insert(*t);


the insertion cause an error when compliling!!!
f.cpp:24: instantiated from here
/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.1/../../../../include/c++/4.1.1/bits/stl_function.h:227: error: no match for ‘operator<’ in ‘__x < __y’
line 24 issec_ts.insert(*t);

Seems fine to me.

1
2
3
4
5
6
7
8
9
10
11
12
13
#include <set>

int main(int argc, char* argv[])
{
	typedef long TS;

	TS w = 7;
	std::set<TS> sec_ts;
	TS* t = new TS(w);
	sec_ts.insert(*t); 

	return 0;
}
so,

TS is class and w is the parameter to instantiate it

1
2
//set<type is a class>sec_ts;
            set <TS> sec_ts;//a set of class TS             


you see with me!
Last edited on
is TS's < operator overloaded?
that is a good RQ !

my pb is resolved!!!
Topic archived. No new replies allowed.