Article View: comp.std.c++
Article #1513Re: Example in "The C++ Workbook" by Wiener and Pinson
From: Paul Sponagl
Date: Mon, 31 Jul 1995 19:03
Date: Mon, 31 Jul 1995 19:03
15 lines
726 bytes
726 bytes
> template < class T >
> void swap(T & item1, T & item2)
> {
> T temp = item1;
> item1 = item2;
> item2 = temp;
> }
or do like that
inline template < class T > void swap(T& a, T& b)
{
a ^=b; b^=a;a ^=b;
}
Technical Details
Message-ID:
<3vj9ak$49m@news.rrz.uni-koeln.de>Path:
arc1-ca.pugleaf.net!RRZ.Uni-Koeln.DE!usenetReferences:
<3ujj8d$o4m@scapa.cs.ualberta.ca> <9520904.20199@mulga.cs.mu.OZ.AU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!RRZ.Uni-Koeln.DE!usenet From: a2675528@athena.rrz.Uni-Koeln.DE (Paul Sponagl) Newsgroups: comp.std.c++ Subject: Re: Example in "The C++ Workbook" by Wiener and Pinson Date: Mon, 31 Jul 1995 19:03:38 GMT Organization: Regional Computing Center, University of Cologne Message-ID: <3vj9ak$49m@news.rrz.uni-koeln.de> References: <3ujj8d$o4m@scapa.cs.ualberta.ca> <9520904.20199@mulga.cs.mu.OZ.AU> NNTP-Posting-Host: a2675528.slip.uni-koeln.de X-Newsreader: Forte Free Agent v0.55