Click here to Skip to main content
15,900,907 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: atlbase.h line 758 assertion failed Pin
hardworkboy13-Dec-05 14:52
hardworkboy13-Dec-05 14:52 
AnswerRe: atlbase.h line 758 assertion failed Pin
Stephen Hewitt8-Jan-06 17:12
Stephen Hewitt8-Jan-06 17:12 
QuestionHow to support session in an ATL web service client app? Pin
CherezZaboro7-Dec-05 7:24
CherezZaboro7-Dec-05 7:24 
QuestionAbout ATL ActiveX Object Pin
elza4-Dec-05 20:25
elza4-Dec-05 20:25 
Questionstring manipulation Pin
alex@zoosmart.us3-Dec-05 21:14
alex@zoosmart.us3-Dec-05 21:14 
AnswerRe: string manipulation Pin
toxcct5-Dec-05 3:31
toxcct5-Dec-05 3:31 
Questionlist class from STL Pin
SanjaySMK1-Dec-05 20:44
SanjaySMK1-Dec-05 20:44 
AnswerRe: list class from STL Pin
Jonas Larsson1-Dec-05 22:37
Jonas Larsson1-Dec-05 22:37 
list::unique works on sorted ranges, so that might explain why you think it doesnt work.

#include <iostream>
#include <list>
//#include <complex>
using namespace std;

struct Complex
{
Complex(int a, int b): i(a), r(b) {}
int i;
int r;
bool operator < (const Complex&c)
{
if (r != c.r)
return r < c.r;
else
return i < c.i;
}

bool operator == (const Complex&c)
{
return r == c.r && i == c.i;
}

friend ostream& operator << (const ostream&out, const Complex& c);
};

ostream& operator << (ostream&out, const Complex& c)
{
out << "(" << c.r << "," << c.i << ")";
return out;
}

int main()
{
list<Complex > l;
for (unsigned int i = 0;i<10;++i)
l.push_back(Complex(1+i%2,2+(i+1)%3));

copy(l.begin(), l.end(), ostream_iterator<Complex >(cout, "\t"));
cout << endl;

l.unique(); // unsorted list, chances are that no elements are equal to its preceding neighbor
copy(l.begin(), l.end(), ostream_iterator<Complex >(cout, "\t"));
cout << endl;

l.sort();
copy(l.begin(), l.end(), ostream_iterator<Complex >(cout, "\t"));
cout << endl;

l.unique();
copy(l.begin(), l.end(), ostream_iterator<Complex >(cout, "\t"));
cout << endl;
return 0;
}

---

"Man will never be free until the last king is strangled with the entrails of the last priest". -- Denis Diderot

AnswerRe: list class from STL Pin
Gast12814-Dec-05 6:05
Gast12814-Dec-05 6:05 
QuestionATL Containment Pin
Eytukan29-Nov-05 21:54
Eytukan29-Nov-05 21:54 
AnswerMr. Alok phoo phoos error Pin
Eytukan30-Nov-05 22:47
Eytukan30-Nov-05 22:47 
GeneralRe: Mr. Alok phoo phoos error Pin
Jörgen Sigvardsson1-Dec-05 9:33
Jörgen Sigvardsson1-Dec-05 9:33 
GeneralRe: Mr. Alok phoo phoos error Pin
Eytukan1-Dec-05 20:39
Eytukan1-Dec-05 20:39 
GeneralRe: Mr. Alok phoo phoos error Pin
Jörgen Sigvardsson1-Dec-05 21:14
Jörgen Sigvardsson1-Dec-05 21:14 
GeneralRe: Mr. Alok phoo phoos error Pin
ThatsAlok4-Dec-05 21:28
ThatsAlok4-Dec-05 21:28 
GeneralRe: Mr. Alok phoo phoos error Pin
ThatsAlok4-Dec-05 21:29
ThatsAlok4-Dec-05 21:29 
QuestionATL/COM Class not registered Problem Pin
Balkrishna Talele28-Nov-05 18:15
Balkrishna Talele28-Nov-05 18:15 
QuestionPassing Arrays from ATL Pin
Eytukan24-Nov-05 0:00
Eytukan24-Nov-05 0:00 
AnswerRe: Passing Arrays from ATL Pin
Stuart Dootson25-Nov-05 21:26
professionalStuart Dootson25-Nov-05 21:26 
AnswerRe: Passing Arrays from ATL Pin
Starick11-Dec-05 22:19
Starick11-Dec-05 22:19 
QuestionContext Menu Of IE Is Not working properly Pin
vijay kumar T23-Nov-05 20:33
vijay kumar T23-Nov-05 20:33 
Questionboost and VS2005 Pin
Ed K22-Nov-05 10:01
Ed K22-Nov-05 10:01 
AnswerRe: boost and VS2005 Pin
Kevin McFarlane22-Nov-05 10:31
Kevin McFarlane22-Nov-05 10:31 
GeneralRe: boost and VS2005 Pin
Ed K22-Nov-05 17:38
Ed K22-Nov-05 17:38 
AnswerRe: boost and VS2005 Pin
Stuart Dootson22-Nov-05 13:10
professionalStuart Dootson22-Nov-05 13:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.