Topic: Internal swap-ing mechanism, All types swap-able and


Author: Christ-Jan Wijtmans <cj.wijtmans@gmail.com>
Date: Sat, 15 Mar 2014 12:39:46 -0700 (PDT)
Raw View
------=_Part_4000_25336262.1394912386337
Content-Type: text/plain; charset=UTF-8

Hello dear good Sir or Madam,

Some about me:
I have 13 years of experience in C++, i started out at 10-11 years old.
C++11 has inspired me to suggest some useful and improving features.

The experience and annoyance:
Currently i am in a huge project of mine and i believe it might reach at
least 30 classes.
That is really hard to maintain, especially now that we have rvalue
references, which i believe is an ingenious invention to solve the temp
objects issue.
However, making sure that so many classes have proper copy operators and
constructors and now in addition rvalue reference operators and
constructors is just a pain to maintain.
Also i noticed that it boils down to duplicated code, that is basically the
same.

To the point(issue):
A proper class that is swap-able and move-able in c++11 looks a lot like
this.

#include <iostream>
class Foo

{

public:

    Foo()

        :ptr(new int(0))

    {

        std::cout << ptr << "()" << std::endl;

    }


    Foo(int val)

        :ptr(new int(val))

    {

        std::cout << ptr << "(" << val << ")" << std::endl;

    }


    Foo(const Foo& other)

        :ptr(new int(other))

    {

        std::cout << ptr << "(&" << other.ptr << ")" << std::endl;

    }


    Foo(Foo&& other)

        :ptr(new int (0))

    {

        std::cout << ptr << "(&&" << other.ptr << ")" << std::endl;

        swap(other);

    }


    ~Foo()

    {

        std::cout << "~" << ptr << std::endl;

        delete ptr;

    }


    Foo& operator=(Foo other)

    {

        std::cout << ptr << "=" << other.ptr << std::endl;

        return swap(other);

    }


    operator int() const

    {

        return *ptr;

    }


    Foo& swap(Foo& other)

    {

        std::cout << ptr << "~" << other.ptr << std::endl;

        std::swap(ptr, other.ptr);

    }

private:

    int *ptr;

};


    int main()

    {

        Foo a(1);

        Foo b(std::move(a));

        std::cout << a << " " << b << std::endl;


        Foo c(2);

        c = std::move(b);

        std::cout << c << " " << b << std::endl;


        Foo d(3);

        d = b;

        std::cout << d << " " << b << std::endl;

    }

0x25216d0(1)
0x2521720(&&0x25216d0)
0x2521720~0x25216d0
0 1
0x2523b60(2)
0x2567d20(&&0x25216d0)
0x2567d20~0x25216d0
0x2523b60=0x25216d0
0x2523b60~0x25216d0
~0x2523b60
1 0
0x2523b60(3)
0x2568c20(&0x2567d20)
0x2523b60=0x2568c20
0x2523b60~0x2568c20
~0x2523b60
0 0
~0x2568c20
~0x25216d0
~0x2567d20
~0x2521720


As you can see here there is a lot of code that can be copy and pasted to
other classes basically.
Why do all this manually, unless in a special case that can be
overloaded? I feel like this should be default behavior, like the copy
constructor is.

In the current situation we have no guarantee that a class is swap-able or
move-able. (Copies instead of swaps)
This guarantee however can make containers a lot more efficient as well
 when dealing with large amounts of data that can basically be swapped.
I propose the syntax a~b for, ::operator~(one, two) which is different from
::operator~(one). The ~ symbol kinda looks like a swapping symbol to me.

This code should be the default behavior for all classes, internal types
such as int or pointers are all swap-able like classes with the ~ operator.
It does the same thing as the default copy constructor except copying it
does swapping.

    Foo& operator~(Foo& other)

    {
        x ~ other.x; //int
        y ~ other.y; //int
        z ~ other.z; //int

        ptr ~ other.ptr; // ptr to int
        bar ~ other.bar; // class Bar

    }


The default copy constructor does not respect initialization, it might work
for PODS but not for classes that take care of pointers or other data.

    Foo& operator=(const Foo& other)

    {

        x = other.x;

        y = other.y;

        z = other.z;

        ptr = other.ptr;
        bar = other.bar;

        return *this;

    }




If we had an internal swap-ing mechanism the default behavior can easily be
replaced with this code.
The copy constructor will work both for PODS and classes that manage points
or other data and respect data initialization.

    Foo& operator=(Foo other)

    {

        return *this ~ other;

    }

or

    Foo& operator=(const Foo& other)

    {

        return *this ~ Foo(other);

    }

    Foo& operator=(Foo&& other)

    {

        return *this ~ other;

    }


The move constructor can have default behavior as well.

    Foo(Foo&& other)

    {
        Foo::Foo(); // default constructor

        *this ~ other;

    }



Finally if we assume this implemented the original class would look like
this and still function the same, in a pointer safe manner.
Also containers can swap the object around efficiently and neither the user
code or the STL implementation has to worry about the safety of the pointer
or the copying large amounts of data due to the lack of a move constructor
or move operator.

class Foo

{

public:

    Foo()

        :ptr(new int(0))

    {

        std::cout << ptr << "()" << std::endl;

    }


    Foo(int val)

        :ptr(new int(val))

    {

        std::cout << ptr << "(" << val << ")" << std::endl;

    }


    Foo(const Foo& other)

        :ptr(new int(other))

    {

        std::cout << ptr << "(&" << other.ptr << ")" << std::endl;

    }


    ~Foo()

    {

        std::cout << "~" << ptr << std::endl;

        delete ptr;

    }


    operator int() const

    {

        return *ptr;

    }

private:

    int *ptr;

};


    int main()

    {

        Foo a(1);

        Foo b(std::move(a));

        std::cout << a << " " << b << std::endl;


        Foo c(2);

        c ~ b;

        std::cout << c << " " << b << std::endl;


        Foo d(3);

        d = b;

        std::cout << d << " " << b << std::endl;

    }



--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_4000_25336262.1394912386337
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hello dear good Sir or Madam,<br><br>Some about me:<br>I h=
ave 13 years of experience in C++, i started out at 10-11 years old. C++11 =
has inspired me to suggest some useful and improving features.<br><br>The e=
xperience and annoyance:<br>Currently i am in a huge project of mine and i =
believe it might reach at least 30 classes.<br>That is really hard to maint=
ain, especially now that we have rvalue references, which i believe is an i=
ngenious invention to solve the temp objects issue.<br>However, making sure=
 that so many classes have proper copy operators and constructors and now i=
n addition rvalue reference operators and constructors is just a pain to ma=
intain.<br>Also i noticed that it boils down to duplicated code, that is ba=
sically the same.<br><br>To the point(issue):<br>A proper class that is swa=
p-able and move-able in c++11 looks a lot like this.<br><div class=3D"prett=
yprint" style=3D"background-color: rgb(250, 250, 250); border: 1px solid rg=
b(187, 187, 187); word-wrap: break-word;"><code class=3D"prettyprint"><div =
class=3D"subprettyprint"><p style=3D"margin-bottom: 0px;"><span style=3D"fo=
nt-family: Arial, Helvetica, sans-serif; color: rgb(128, 128, 0);"><span st=
yle=3D"color: #800;" class=3D"styled-by-prettify">#include</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"colo=
r: #080;" class=3D"styled-by-prettify">&lt;iostream&gt;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">class</span></span><span style=3D"=
font-family: Arial, Helvetica, sans-serif; color: rgb(192, 192, 192);"><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><span =
style=3D"font-family: Arial, Helvetica, sans-serif; color: rgb(128, 0, 128)=
;"><span style=3D"color: #606;" class=3D"styled-by-prettify">Foo</span></sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span></p=
><pre><span style=3D" color:#000000;"><span style=3D"color: #660;" class=3D=
"styled-by-prettify">{</span></span></pre><pre><span style=3D" color:#80800=
0;"><span style=3D"color: #008;" class=3D"styled-by-prettify">public</span>=
</span><span style=3D" color:#000000;"><span style=3D"color: #660;" class=
=3D"styled-by-prettify">:</span></span></pre><pre><span style=3D" color:#c0=
c0c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify"> &nbsp; &n=
bsp;</span></span><span style=3D" color:#800080;"><span style=3D"color: #60=
6;" class=3D"styled-by-prettify">Foo</span></span><span style=3D" color:#00=
0000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">()</span><=
/span></pre><pre><span style=3D" color:#c0c0c0;"><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> &nbsp; &nbsp; &nbsp; &nbsp;</span></span><=
span style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled=
-by-prettify">:</span></span><span style=3D" color:#800000;"><span style=3D=
"color: #000;" class=3D"styled-by-prettify">ptr</span></span><span style=3D=
" color:#000000;"><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>(</span></span><span style=3D" color:#808000;"><span style=3D"color: #008;=
" class=3D"styled-by-prettify">new</span></span><span style=3D" color:#c0c0=
c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span></sp=
an><span style=3D" color:#808000;"><span style=3D"color: #008;" class=3D"st=
yled-by-prettify">int</span></span><span style=3D" color:#000000;"><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">(</span></span><span styl=
e=3D" color:#000080;"><span style=3D"color: #066;" class=3D"styled-by-prett=
ify">0</span></span><span style=3D" color:#000000;"><span style=3D"color: #=
660;" class=3D"styled-by-prettify">))</span></span></pre><pre><span style=
=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> &nbsp; &nbsp;</span></span><span style=3D" color:#000000;"><span style=
=3D"color: #660;" class=3D"styled-by-prettify">{</span></span></pre><pre><s=
pan style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-=
by-prettify"> &nbsp; &nbsp; &nbsp; &nbsp;</span></span><span style=3D" colo=
r:#800080;"><span style=3D"color: #000;" class=3D"styled-by-prettify">std</=
span></span><span style=3D" color:#000000;"><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">::</span></span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify">cout</span><span style=3D" color:#c0c0c0;"><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><span st=
yle=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">&lt;&lt;</span></span><span style=3D" color:#c0c0c0;"><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> </span></span><span style=3D" =
color:#800000;"><span style=3D"color: #000;" class=3D"styled-by-prettify">p=
tr</span></span><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> </span></span><span style=3D" color:#000000=
;"><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;&lt;</span=
></span><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span></span><span style=3D" color:#008000;"><spa=
n style=3D"color: #080;" class=3D"styled-by-prettify">"()"</span></span><sp=
an style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> </span></span><span style=3D" color:#000000;"><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">&lt;&lt;</span></span><span style=
=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span></span><span style=3D" color:#800080;"><span style=3D"color: #0=
00;" class=3D"styled-by-prettify">std</span></span><span style=3D" color:#0=
00000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span>=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify">endl</span=
><span style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">;</span></span></pre><pre><span style=3D" color:#c0c0c0;"><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> &nbsp; &nbsp;</sp=
an></span><span style=3D" color:#000000;"><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">}</span></span></pre><pre><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"><br></span></pre><pre><span style=3D" col=
or:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify">&nbs=
p; &nbsp; </span></span><span style=3D" color:#800080;"><span style=3D"colo=
r: #606;" class=3D"styled-by-prettify">Foo</span></span><span style=3D" col=
or:#000000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">(</s=
pan></span><span style=3D" color:#808000;"><span style=3D"color: #008;" cla=
ss=3D"styled-by-prettify">int</span></span><span style=3D" color:#c0c0c0;">=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><s=
pan style=3D" color:#000000;"><span style=3D"color: #000;" class=3D"styled-=
by-prettify">val</span></span><span style=3D" color:#000000;"><span style=
=3D"color: #660;" class=3D"styled-by-prettify">)</span></span></pre><pre><s=
pan style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-=
by-prettify"> &nbsp; &nbsp; &nbsp; &nbsp;</span></span><span style=3D" colo=
r:#000000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">:</sp=
an></span><span style=3D" color:#800000;"><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify">ptr</span></span><span style=3D" color:#000000;"><=
span style=3D"color: #660;" class=3D"styled-by-prettify">(</span></span><sp=
an style=3D" color:#808000;"><span style=3D"color: #008;" class=3D"styled-b=
y-prettify">new</span></span><span style=3D" color:#c0c0c0;"><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> </span></span><span style=3D" =
color:#808000;"><span style=3D"color: #008;" class=3D"styled-by-prettify">i=
nt</span></span><span style=3D" color:#000000;"><span style=3D"color: #660;=
" class=3D"styled-by-prettify">(</span></span><span style=3D" color:#000000=
;"><span style=3D"color: #000;" class=3D"styled-by-prettify">val</span></sp=
an><span style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">))</span></span></pre><pre><span style=3D" color:#c0c0c0;=
"><span style=3D"color: #000;" class=3D"styled-by-prettify"> &nbsp; &nbsp;<=
/span></span><span style=3D" color:#000000;"><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">{</span></span></pre><pre><span style=3D" color=
:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify"> &nbsp=
; &nbsp; &nbsp; &nbsp;</span></span><span style=3D" color:#800080;"><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify">std</span></span><span s=
tyle=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">::</span></span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify">cout</span><span style=3D" color:#c0c0c0;"><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> </span></span><span style=3D" color:#0000=
00;"><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;&lt;</sp=
an></span><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> </span></span><span style=3D" color:#800000;"><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify">ptr</span></span><sp=
an style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> </span></span><span style=3D" color:#000000;"><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">&lt;&lt;</span></span><span style=
=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span></span><span style=3D" color:#008000;"><span style=3D"color: #0=
80;" class=3D"styled-by-prettify">"("</span></span><span style=3D" color:#c=
0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><=
/span><span style=3D" color:#000000;"><span style=3D"color: #660;" class=3D=
"styled-by-prettify">&lt;&lt;</span></span><span style=3D" color:#c0c0c0;">=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><s=
pan style=3D" color:#000000;"><span style=3D"color: #000;" class=3D"styled-=
by-prettify">val</span></span><span style=3D" color:#c0c0c0;"><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><span style=
=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">&lt;&lt;</span></span><span style=3D" color:#c0c0c0;"><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> </span></span><span style=3D" col=
or:#008000;"><span style=3D"color: #080;" class=3D"styled-by-prettify">")"<=
/span></span><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> </span></span><span style=3D" color:#000000;">=
<span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;&lt;</span></=
span><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> </span></span><span style=3D" color:#800080;"><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify">std</span></span><span st=
yle=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">::</span></span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify">endl</span><span style=3D" color:#000000;"><span style=3D"color: #660=
;" class=3D"styled-by-prettify">;</span></span></pre><pre><span style=3D" c=
olor:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify"> &=
nbsp; &nbsp;</span></span><span style=3D" color:#000000;"><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">}</span></span></pre><pre><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br></span></pre><pre><sp=
an style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-b=
y-prettify">&nbsp; &nbsp; </span></span><span style=3D" color:#800080;"><sp=
an style=3D"color: #606;" class=3D"styled-by-prettify">Foo</span></span><sp=
an style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">(</span></span><span style=3D" color:#808000;"><span style=3D"c=
olor: #008;" class=3D"styled-by-prettify">const</span></span><span style=3D=
" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> </span></span><span style=3D" color:#800080;"><span style=3D"color: #606;=
" class=3D"styled-by-prettify">Foo</span></span><span style=3D" color:#0000=
00;"><span style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span>=
</span><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span></span><span style=3D" color:#000000;"><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify">other</span></span><s=
pan style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-=
by-prettify">)</span></span></pre><pre><span style=3D" color:#c0c0c0;"><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> &nbsp; &nbsp; &nbsp;=
 &nbsp;</span></span><span style=3D" color:#000000;"><span style=3D"color: =
#660;" class=3D"styled-by-prettify">:</span></span><span style=3D" color:#8=
00000;"><span style=3D"color: #000;" class=3D"styled-by-prettify">ptr</span=
></span><span style=3D" color:#000000;"><span style=3D"color: #660;" class=
=3D"styled-by-prettify">(</span></span><span style=3D" color:#808000;"><spa=
n style=3D"color: #008;" class=3D"styled-by-prettify">new</span></span><spa=
n style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> </span></span><span style=3D" color:#808000;"><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">int</span></span><span style=3D" c=
olor:#000000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">(<=
/span></span><span style=3D" color:#000000;"><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify">other</span></span><span style=3D" color:#00000=
0;"><span style=3D"color: #660;" class=3D"styled-by-prettify">))</span></sp=
an></pre><pre><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> &nbsp; &nbsp;</span></span><span style=3D" co=
lor:#000000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">{</=
span></span></pre><pre><span style=3D" color:#c0c0c0;"><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> &nbsp; &nbsp; &nbsp; &nbsp;</span></=
span><span style=3D" color:#800080;"><span style=3D"color: #000;" class=3D"=
styled-by-prettify">std</span></span><span style=3D" color:#000000;"><span =
style=3D"color: #660;" class=3D"styled-by-prettify">::</span></span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify">cout</span><span style=
=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span></span><span style=3D" color:#000000;"><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">&lt;&lt;</span></span><span style=3D" col=
or:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify"> </s=
pan></span><span style=3D" color:#800000;"><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify">ptr</span></span><span style=3D" color:#c0c0c0;">=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><s=
pan style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-=
by-prettify">&lt;&lt;</span></span><span style=3D" color:#c0c0c0;"><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><span styl=
e=3D" color:#008000;"><span style=3D"color: #080;" class=3D"styled-by-prett=
ify">"(&amp;"</span></span><span style=3D" color:#c0c0c0;"><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> </span></span><span style=3D" co=
lor:#000000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt=
;&lt;</span></span><span style=3D" color:#c0c0c0;"><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> </span></span><span style=3D" color:#000=
000;"><span style=3D"color: #000;" class=3D"styled-by-prettify">other</span=
></span><span style=3D" color:#000000;"><span style=3D"color: #660;" class=
=3D"styled-by-prettify">.</span></span><span style=3D" color:#800000;"><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify">ptr</span></span><spa=
n style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> </span></span><span style=3D" color:#000000;"><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">&lt;&lt;</span></span><span style=
=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span></span><span style=3D" color:#008000;"><span style=3D"color: #0=
80;" class=3D"styled-by-prettify">")"</span></span><span style=3D" color:#c=
0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><=
/span><span style=3D" color:#000000;"><span style=3D"color: #660;" class=3D=
"styled-by-prettify">&lt;&lt;</span></span><span style=3D" color:#c0c0c0;">=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><s=
pan style=3D" color:#800080;"><span style=3D"color: #000;" class=3D"styled-=
by-prettify">std</span></span><span style=3D" color:#000000;"><span style=
=3D"color: #660;" class=3D"styled-by-prettify">::</span></span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">endl</span><span style=3D" c=
olor:#000000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">;<=
/span></span></pre><pre><span style=3D" color:#c0c0c0;"><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> &nbsp; &nbsp;</span></span><span st=
yle=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">}</span></span></pre><pre><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"><br></span></pre><pre><span style=3D" color:#c0c0c0;"><span=
 style=3D"color: #000;" class=3D"styled-by-prettify">&nbsp; &nbsp; </span><=
/span><span style=3D" color:#800080;"><span style=3D"color: #606;" class=3D=
"styled-by-prettify">Foo</span></span><span style=3D" color:#000000;"><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">(</span></span><span s=
tyle=3D" color:#800080;"><span style=3D"color: #606;" class=3D"styled-by-pr=
ettify">Foo</span></span><span style=3D" color:#000000;"><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">&amp;&amp;</span></span><span style=
=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span></span><span style=3D" color:#000000;"><span style=3D"color: #0=
00;" class=3D"styled-by-prettify">other</span></span><span style=3D" color:=
#000000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">)</span=
></span></pre><pre><span style=3D" color:#c0c0c0;"><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> &nbsp; &nbsp; &nbsp; &nbsp;</span></span=
><span style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">:</span></span><span style=3D" color:#800000;"><span style=
=3D"color: #000;" class=3D"styled-by-prettify">ptr</span></span><span style=
=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">(</span></span><span style=3D" color:#808000;"><span style=3D"color: #0=
08;" class=3D"styled-by-prettify">new</span></span><span style=3D" color:#c=
0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><=
/span><span style=3D" color:#808000;"><span style=3D"color: #008;" class=3D=
"styled-by-prettify">int</span></span><span style=3D" color:#c0c0c0;"><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><span s=
tyle=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">(</span></span><span style=3D" color:#000080;"><span style=3D"color=
: #066;" class=3D"styled-by-prettify">0</span></span><span style=3D" color:=
#000000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">))</spa=
n></span></pre><pre><span style=3D" color:#c0c0c0;"><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> &nbsp; &nbsp;</span></span><span style=
=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">{</span></span></pre><pre><span style=3D" color:#c0c0c0;"><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> &nbsp; &nbsp; &nbsp; &nbsp;=
</span></span><span style=3D" color:#800080;"><span style=3D"color: #000;" =
class=3D"styled-by-prettify">std</span></span><span style=3D" color:#000000=
;"><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span></spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify">cout</span><spa=
n style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> </span></span><span style=3D" color:#000000;"><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">&lt;&lt;</span></span><span style=
=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span></span><span style=3D" color:#800000;"><span style=3D"color: #0=
00;" class=3D"styled-by-prettify">ptr</span></span><span style=3D" color:#c=
0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><=
/span><span style=3D" color:#000000;"><span style=3D"color: #660;" class=3D=
"styled-by-prettify">&lt;&lt;</span></span><span style=3D" color:#c0c0c0;">=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><s=
pan style=3D" color:#008000;"><span style=3D"color: #080;" class=3D"styled-=
by-prettify">"(&amp;&amp;"</span></span><span style=3D" color:#c0c0c0;"><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><span=
 style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-by-=
prettify">&lt;&lt;</span></span><span style=3D" color:#c0c0c0;"><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><span style=
=3D" color:#000000;"><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy">other</span></span><span style=3D" color:#000000;"><span style=3D"color=
: #660;" class=3D"styled-by-prettify">.</span></span><span style=3D" color:=
#800000;"><span style=3D"color: #000;" class=3D"styled-by-prettify">ptr</sp=
an></span><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> </span></span><span style=3D" color:#000000;"><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">&lt;&lt;</span></spa=
n><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> </span></span><span style=3D" color:#008000;"><span style=
=3D"color: #080;" class=3D"styled-by-prettify">")"</span></span><span style=
=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span></span><span style=3D" color:#000000;"><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">&lt;&lt;</span></span><span style=3D" col=
or:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify"> </s=
pan></span><span style=3D" color:#800080;"><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify">std</span></span><span style=3D" color:#000000;">=
<span style=3D"color: #660;" class=3D"styled-by-prettify">::</span></span><=
span style=3D"color: #000;" class=3D"styled-by-prettify">endl</span><span s=
tyle=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">;</span></span></pre><pre><span style=3D" color:#c0c0c0;"><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"> &nbsp; &nbsp; &nbsp; &nbs=
p;</span></span><span style=3D" color:#000000;"><span style=3D"color: #000;=
" class=3D"styled-by-prettify">swap</span></span><span style=3D" color:#000=
000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span></s=
pan><span style=3D" color:#000000;"><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify">other</span></span><span style=3D" color:#000000;"><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">);</span></span></pre>=
<pre><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> &nbsp; &nbsp;</span></span><span style=3D" color:#0000=
00;"><span style=3D"color: #660;" class=3D"styled-by-prettify">}</span></sp=
an></pre><pre><span style=3D"color: #000;" class=3D"styled-by-prettify"><br=
></span></pre><pre><span style=3D" color:#c0c0c0;"><span style=3D"color: #0=
00;" class=3D"styled-by-prettify">&nbsp; &nbsp; </span></span><span style=
=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">~</span></span><span style=3D" color:#800080;"><span style=3D"color: #6=
06;" class=3D"styled-by-prettify">Foo</span></span><span style=3D" color:#0=
00000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">()</span>=
</span></pre><pre><span style=3D" color:#c0c0c0;"><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> &nbsp; &nbsp;</span></span><span style=3D=
" color:#000000;"><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>{</span></span></pre><pre><span style=3D" color:#c0c0c0;"><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> &nbsp; &nbsp; &nbsp; &nbsp;</spa=
n></span><span style=3D" color:#800080;"><span style=3D"color: #000;" class=
=3D"styled-by-prettify">std</span></span><span style=3D" color:#000000;"><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">::</span></span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify">cout</span><span sty=
le=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> </span></span><span style=3D" color:#000000;"><span style=3D"color: =
#660;" class=3D"styled-by-prettify">&lt;&lt;</span></span><span style=3D" c=
olor:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify"> <=
/span></span><span style=3D" color:#008000;"><span style=3D"color: #080;" c=
lass=3D"styled-by-prettify">"~"</span></span><span style=3D" color:#c0c0c0;=
"><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span></span>=
<span style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"style=
d-by-prettify">&lt;&lt;</span></span><span style=3D" color:#c0c0c0;"><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><span st=
yle=3D" color:#800000;"><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify">ptr</span></span><span style=3D" color:#c0c0c0;"><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> </span></span><span style=3D" color=
:#000000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;&l=
t;</span></span><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> </span></span><span style=3D" color:#800080=
;"><span style=3D"color: #000;" class=3D"styled-by-prettify">std</span></sp=
an><span style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">::</span></span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify">endl</span><span style=3D" color:#000000;"><span style=3D"=
color: #660;" class=3D"styled-by-prettify">;</span></span></pre><pre><span =
style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> &nbsp; &nbsp; &nbsp; &nbsp;</span></span><span style=3D" color:#8=
08000;"><span style=3D"color: #008;" class=3D"styled-by-prettify">delete</s=
pan></span><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"> </span></span><span style=3D" color:#800000;"><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify">ptr</span></span><s=
pan style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-=
by-prettify">;</span></span></pre><pre><span style=3D" color:#c0c0c0;"><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> &nbsp; &nbsp;</span>=
</span><span style=3D" color:#000000;"><span style=3D"color: #660;" class=
=3D"styled-by-prettify">}</span></span></pre><pre><span style=3D"font-famil=
y: Arial, Helvetica, sans-serif; color: rgb(192, 192, 192);"><span style=3D=
"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; &nbsp; </span></span=
><span style=3D"font-family: Arial, Helvetica, sans-serif; color: rgb(128, =
0, 128);"><span style=3D"color: #606;" class=3D"styled-by-prettify">Foo</sp=
an></span><span style=3D"font-family: Arial, Helvetica, sans-serif; color: =
rgb(0, 0, 0);"><span style=3D"color: #660;" class=3D"styled-by-prettify">&a=
mp;</span></span><span style=3D"font-family: Arial, Helvetica, sans-serif; =
color: rgb(192, 192, 192);"><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> </span></span><span style=3D"font-family: Arial, Helvetica, san=
s-serif; color: rgb(0, 0, 0);"><span style=3D"color: #008;" class=3D"styled=
-by-prettify">operator</span></span><span style=3D"font-family: Arial, Helv=
etica, sans-serif; color: rgb(0, 0, 0);"><span style=3D"color: #660;" class=
=3D"styled-by-prettify">=3D(</span></span><span style=3D"font-family: Arial=
, Helvetica, sans-serif; color: rgb(128, 0, 128);"><span style=3D"color: #6=
06;" class=3D"styled-by-prettify">Foo</span></span><span style=3D"font-fami=
ly: Arial, Helvetica, sans-serif; color: rgb(192, 192, 192);"><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><span style=
=3D"font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0);"><span =
style=3D"color: #000;" class=3D"styled-by-prettify">other</span></span><spa=
n style=3D"font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0);"=
><span style=3D"color: #660;" class=3D"styled-by-prettify">)</span></span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span></pre><=
pre><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify">&nbsp; &nbsp; </span></span><span style=3D" color:#00000=
0;"><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span></spa=
n></pre><pre><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> &nbsp; &nbsp; &nbsp; &nbsp;</span></span><span=
 style=3D" color:#800080;"><span style=3D"color: #000;" class=3D"styled-by-=
prettify">std</span></span><span style=3D" color:#000000;"><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">::</span></span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify">cout</span><span style=3D" color:#=
c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span>=
</span><span style=3D" color:#000000;"><span style=3D"color: #660;" class=
=3D"styled-by-prettify">&lt;&lt;</span></span><span style=3D" color:#c0c0c0=
;"><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span></span=
><span style=3D" color:#800000;"><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify">ptr</span></span><span style=3D" color:#c0c0c0;"><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><span style=
=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">&lt;&lt;</span></span><span style=3D" color:#c0c0c0;"><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> </span></span><span style=3D" col=
or:#008000;"><span style=3D"color: #080;" class=3D"styled-by-prettify">"=3D=
"</span></span><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> </span></span><span style=3D" color:#000000;=
"><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;&lt;</span>=
</span><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span></span><span style=3D" color:#000000;"><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify">other</span></span><s=
pan style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-=
by-prettify">.</span></span><span style=3D" color:#800000;"><span style=3D"=
color: #000;" class=3D"styled-by-prettify">ptr</span></span><span style=3D"=
 color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify">=
 </span></span><span style=3D" color:#000000;"><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">&lt;&lt;</span></span><span style=3D" color:#=
c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span>=
</span><span style=3D" color:#800080;"><span style=3D"color: #000;" class=
=3D"styled-by-prettify">std</span></span><span style=3D" color:#000000;"><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">::</span></span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify">endl</span><span sty=
le=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">;</span></span></pre><pre><span style=3D" color:#c0c0c0;"><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> &nbsp; &nbsp; &nbsp; &nbsp;=
</span></span><span style=3D" color:#808000;"><span style=3D"color: #008;" =
class=3D"styled-by-prettify">return</span></span><span style=3D" color:#c0c=
0c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span></s=
pan><span style=3D" color:#000000;"><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify">swap</span></span><span style=3D" color:#000000;"><span =
style=3D"color: #660;" class=3D"styled-by-prettify">(</span></span><span st=
yle=3D" color:#000000;"><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify">other</span></span><span style=3D" color:#000000;"><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">);</span></span></pre><pre><span s=
tyle=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> &nbsp; &nbsp;</span></span><span style=3D" color:#000000;"><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">}</span></span></pre><pr=
e><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span></pr=
e><pre><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=
=3D"styled-by-prettify">&nbsp; &nbsp; </span></span><span style=3D" color:#=
808000;"><span style=3D"color: #008;" class=3D"styled-by-prettify">operator=
</span></span><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> </span></span><span style=3D" color:#808000;"=
><span style=3D"color: #008;" class=3D"styled-by-prettify">int</span></span=
><span style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">()</span></span><span style=3D" color:#c0c0c0;"><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><span style=
=3D" color:#808000;"><span style=3D"color: #008;" class=3D"styled-by-pretti=
fy">const</span></span></pre><pre><span style=3D" color:#c0c0c0;"><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"> &nbsp; &nbsp;</span></spa=
n><span style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">{</span></span></pre><pre><span style=3D" color:#c0c0c0;">=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> &nbsp; &nbsp; &n=
bsp; &nbsp;</span></span><span style=3D" color:#808000;"><span style=3D"col=
or: #008;" class=3D"styled-by-prettify">return</span></span><span style=3D"=
 color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify">=
 </span></span><span style=3D" color:#000000;"><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">*</span></span><span style=3D" color:#800000;=
"><span style=3D"color: #000;" class=3D"styled-by-prettify">ptr</span></spa=
n><span style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">;</span></span></pre><pre><span style=3D" color:#c0c0c0;">=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> &nbsp; &nbsp;</s=
pan></span><span style=3D" color:#000000;"><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">}</span></span></pre><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"><br></span><pre><span style=3D"font-family: A=
rial, Helvetica, sans-serif; color: rgb(192, 192, 192);"><span style=3D"col=
or: #000;" class=3D"styled-by-prettify">&nbsp; &nbsp; </span></span><span s=
tyle=3D"font-family: Arial, Helvetica, sans-serif; color: rgb(128, 0, 128);=
"><span style=3D"color: #606;" class=3D"styled-by-prettify">Foo</span></spa=
n><span style=3D"font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0=
, 0);"><span style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</spa=
n></span><span style=3D"font-family: Arial, Helvetica, sans-serif; color: r=
gb(192, 192, 192);"><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> </span></span><span style=3D"font-family: Arial, Helvetica, sans-serif;=
 color: rgb(0, 0, 0);"><span style=3D"color: #000;" class=3D"styled-by-pret=
tify">swap</span></span><span style=3D"font-family: Arial, Helvetica, sans-=
serif; color: rgb(0, 0, 0);"><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">(</span></span><span style=3D"font-family: Arial, Helvetica, sa=
ns-serif; color: rgb(128, 0, 128);"><span style=3D"color: #606;" class=3D"s=
tyled-by-prettify">Foo</span></span><span style=3D"font-family: Arial, Helv=
etica, sans-serif; color: rgb(0, 0, 0);"><span style=3D"color: #660;" class=
=3D"styled-by-prettify">&amp;</span></span><span style=3D"font-family: Aria=
l, Helvetica, sans-serif; color: rgb(192, 192, 192);"><span style=3D"color:=
 #000;" class=3D"styled-by-prettify"> </span></span><span style=3D"font-fam=
ily: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0);"><span style=3D"col=
or: #000;" class=3D"styled-by-prettify">other</span></span><span style=3D"f=
ont-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0);"><span style=
=3D"color: #660;" class=3D"styled-by-prettify">)</span></span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br></span></pre><pre><span =
style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-p=
rettify">&nbsp; &nbsp; </span></span><span style=3D" color:#000000;"><span =
style=3D"color: #660;" class=3D"styled-by-prettify">{</span></span></pre><p=
re><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> &nbsp; &nbsp; &nbsp; &nbsp;</span></span><span style=3D"=
 color:#800080;"><span style=3D"color: #000;" class=3D"styled-by-prettify">=
std</span></span><span style=3D" color:#000000;"><span style=3D"color: #660=
;" class=3D"styled-by-prettify">::</span></span><span style=3D"color: #000;=
" class=3D"styled-by-prettify">cout</span><span style=3D" color:#c0c0c0;"><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><sp=
an style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">&lt;&lt;</span></span><span style=3D" color:#c0c0c0;"><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><span style=
=3D" color:#800000;"><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy">ptr</span></span><span style=3D" color:#c0c0c0;"><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> </span></span><span style=3D" color:#0=
00000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;&lt;<=
/span></span><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> </span></span><span style=3D" color:#008000;">=
<span style=3D"color: #080;" class=3D"styled-by-prettify">"~"</span></span>=
<span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> </span></span><span style=3D" color:#000000;"><span style=
=3D"color: #660;" class=3D"styled-by-prettify">&lt;&lt;</span></span><span =
style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> </span></span><span style=3D" color:#000000;"><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify">other</span></span><span style=3D" c=
olor:#000000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">.<=
/span></span><span style=3D" color:#800000;"><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify">ptr</span></span><span style=3D" color:#c0c0c0;=
"><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span></span>=
<span style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"style=
d-by-prettify">&lt;&lt;</span></span><span style=3D" color:#c0c0c0;"><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><span st=
yle=3D" color:#800080;"><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify">std</span></span><span style=3D" color:#000000;"><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">::</span></span><span style=3D"color=
: #000;" class=3D"styled-by-prettify">endl</span><span style=3D" color:#000=
000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span></s=
pan></pre><pre><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> &nbsp; &nbsp; &nbsp; &nbsp;</span></span><sp=
an style=3D" color:#800080;"><span style=3D"color: #000;" class=3D"styled-b=
y-prettify">std</span></span><span style=3D" color:#000000;"><span style=3D=
"color: #660;" class=3D"styled-by-prettify">::</span></span><span style=3D"=
 color:#000000;"><span style=3D"color: #000;" class=3D"styled-by-prettify">=
swap</span></span><span style=3D" color:#000000;"><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">(</span></span><span style=3D" color:#8000=
00;"><span style=3D"color: #000;" class=3D"styled-by-prettify">ptr</span></=
span><span style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"=
styled-by-prettify">,</span></span><span style=3D" color:#c0c0c0;"><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><span styl=
e=3D" color:#000000;"><span style=3D"color: #000;" class=3D"styled-by-prett=
ify">other</span></span><span style=3D" color:#000000;"><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">.</span></span><span style=3D" color=
:#800000;"><span style=3D"color: #000;" class=3D"styled-by-prettify">ptr</s=
pan></span><span style=3D" color:#000000;"><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">);</span></span></pre><pre><span style=3D" color:=
#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify"> &nbsp;=
 &nbsp;</span></span><span style=3D" color:#000000;"><span style=3D"color: =
#660;" class=3D"styled-by-prettify">}</span></span></pre><pre><span style=
=3D"font-family: Arial, Helvetica, sans-serif; color: rgb(128, 128, 0);"><s=
pan style=3D"color: #008;" class=3D"styled-by-prettify">private</span></spa=
n><span style=3D"font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0=
, 0);"><span style=3D"color: #660;" class=3D"styled-by-prettify">:</span></=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><=
/pre><pre><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify">&nbsp; &nbsp; </span></span><span style=3D" color:=
#808000;"><span style=3D"color: #008;" class=3D"styled-by-prettify">int</sp=
an></span><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> </span></span><span style=3D" color:#000000;"><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">*</span></span><span=
 style=3D" color:#800000;"><span style=3D"color: #000;" class=3D"styled-by-=
prettify">ptr</span></span><span style=3D" color:#000000;"><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">;</span></span></pre><pre><span s=
tyle=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">};</span></span></pre><pre><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"><br></span></pre><pre><span style=3D" color:#c0c0c0;"><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify">&nbsp; &nbsp; </span=
></span><span style=3D" color:#808000;"><span style=3D"color: #008;" class=
=3D"styled-by-prettify">int</span></span><span style=3D" color:#c0c0c0;"><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><spa=
n style=3D" color:#000000;"><span style=3D"color: #000;" class=3D"styled-by=
-prettify">main</span></span><span style=3D" color:#000000;"><span style=3D=
"color: #660;" class=3D"styled-by-prettify">()</span></span></pre><pre><spa=
n style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> &nbsp; &nbsp;</span></span><span style=3D" color:#000000;"><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">{</span></span></pre>=
<pre><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> &nbsp; &nbsp; &nbsp; &nbsp;</span></span><span style=
=3D" color:#800080;"><span style=3D"color: #606;" class=3D"styled-by-pretti=
fy">Foo</span></span><span style=3D" color:#c0c0c0;"><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> </span></span><span style=3D" color:#0=
00000;"><span style=3D"color: #000;" class=3D"styled-by-prettify">a</span><=
/span><span style=3D" color:#000000;"><span style=3D"color: #660;" class=3D=
"styled-by-prettify">(</span></span><span style=3D" color:#000080;"><span s=
tyle=3D"color: #066;" class=3D"styled-by-prettify">1</span></span><span sty=
le=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">);</span></span></pre><pre><span style=3D" color:#c0c0c0;"><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> &nbsp; &nbsp; &nbsp; &nbsp=
;</span></span><span style=3D" color:#800080;"><span style=3D"color: #606;"=
 class=3D"styled-by-prettify">Foo</span></span><span style=3D" color:#c0c0c=
0;"><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span></spa=
n><span style=3D" color:#000000;"><span style=3D"color: #000;" class=3D"sty=
led-by-prettify">b</span></span><span style=3D" color:#000000;"><span style=
=3D"color: #660;" class=3D"styled-by-prettify">(</span></span><span style=
=3D" color:#800080;"><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy">std</span></span><span style=3D" color:#000000;"><span style=3D"color: =
#660;" class=3D"styled-by-prettify">::</span></span><span style=3D"color: #=
000;" class=3D"styled-by-prettify">move</span><span style=3D" color:#000000=
;"><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span></span=
><span style=3D" color:#000000;"><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify">a</span></span><span style=3D" color:#000000;"><span style=
=3D"color: #660;" class=3D"styled-by-prettify">));</span></span></pre><pre>=
<span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> &nbsp; &nbsp; &nbsp; &nbsp;</span></span><span style=3D" co=
lor:#800080;"><span style=3D"color: #000;" class=3D"styled-by-prettify">std=
</span></span><span style=3D" color:#000000;"><span style=3D"color: #660;" =
class=3D"styled-by-prettify">::</span></span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify">cout</span><span style=3D" color:#c0c0c0;"><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><span =
style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">&lt;&lt;</span></span><span style=3D" color:#c0c0c0;"><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><span style=
=3D" color:#000000;"><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy">a</span></span><span style=3D" color:#c0c0c0;"><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> </span></span><span style=3D" color:#000=
000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;&lt;</s=
pan></span><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"> </span></span><span style=3D" color:#008000;"><s=
pan style=3D"color: #080;" class=3D"styled-by-prettify">"</span></span><spa=
n style=3D" color:#c0c0c0;"><span style=3D"color: #080;" class=3D"styled-by=
-prettify"> </span></span><span style=3D" color:#008000;"><span style=3D"co=
lor: #080;" class=3D"styled-by-prettify">"</span></span><span style=3D" col=
or:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify"> </s=
pan></span><span style=3D" color:#000000;"><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">&lt;&lt;</span></span><span style=3D" color:#c0c0=
c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span></sp=
an><span style=3D" color:#000000;"><span style=3D"color: #000;" class=3D"st=
yled-by-prettify">b</span></span><span style=3D" color:#c0c0c0;"><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><span style=
=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">&lt;&lt;</span></span><span style=3D" color:#c0c0c0;"><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> </span></span><span style=3D" col=
or:#800080;"><span style=3D"color: #000;" class=3D"styled-by-prettify">std<=
/span></span><span style=3D" color:#000000;"><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">::</span></span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify">endl</span><span style=3D" color:#000000;"><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">;</span></span></pre><=
span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><pre><s=
pan style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-=
by-prettify">&nbsp; &nbsp; &nbsp; &nbsp; </span></span><span style=3D" colo=
r:#800080;"><span style=3D"color: #606;" class=3D"styled-by-prettify">Foo</=
span></span><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> </span></span><span style=3D" color:#000000;"><=
span style=3D"color: #000;" class=3D"styled-by-prettify">c</span></span><sp=
an style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">(</span></span><span style=3D" color:#000080;"><span style=3D"c=
olor: #066;" class=3D"styled-by-prettify">2</span></span><span style=3D" co=
lor:#000000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">);<=
/span></span></pre><pre><span style=3D" color:#c0c0c0;"><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> &nbsp; &nbsp; &nbsp; &nbsp;</span><=
/span><span style=3D" color:#000000;"><span style=3D"color: #000;" class=3D=
"styled-by-prettify">c</span></span><span style=3D" color:#c0c0c0;"><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><span sty=
le=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">=3D</span></span><span style=3D" color:#c0c0c0;"><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> </span></span><span style=3D" color:=
#800080;"><span style=3D"color: #000;" class=3D"styled-by-prettify">std</sp=
an></span><span style=3D" color:#000000;"><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">::</span></span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">move</span><span style=3D" color:#000000;"><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">(</span></span><span styl=
e=3D" color:#000000;"><span style=3D"color: #000;" class=3D"styled-by-prett=
ify">b</span></span><span style=3D" color:#000000;"><span style=3D"color: #=
660;" class=3D"styled-by-prettify">);</span></span></pre><pre><span style=
=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> &nbsp; &nbsp; &nbsp; &nbsp;</span></span><span style=3D" color:#800080=
;"><span style=3D"color: #000;" class=3D"styled-by-prettify">std</span></sp=
an><span style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">::</span></span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify">cout</span><span style=3D" color:#c0c0c0;"><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> </span></span><span style=3D" c=
olor:#000000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">&l=
t;&lt;</span></span><span style=3D" color:#c0c0c0;"><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> </span></span><span style=3D" color:#00=
0000;"><span style=3D"color: #000;" class=3D"styled-by-prettify">c</span></=
span><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> </span></span><span style=3D" color:#000000;"><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">&lt;&lt;</span></span><sp=
an style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> </span></span><span style=3D" color:#008000;"><span style=3D"c=
olor: #080;" class=3D"styled-by-prettify">"</span></span><span style=3D" co=
lor:#c0c0c0;"><span style=3D"color: #080;" class=3D"styled-by-prettify"> </=
span></span><span style=3D" color:#008000;"><span style=3D"color: #080;" cl=
ass=3D"styled-by-prettify">"</span></span><span style=3D" color:#c0c0c0;"><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><sp=
an style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">&lt;&lt;</span></span><span style=3D" color:#c0c0c0;"><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><span style=
=3D" color:#000000;"><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy">b</span></span><span style=3D" color:#c0c0c0;"><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> </span></span><span style=3D" color:#000=
000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;&lt;</s=
pan></span><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"> </span></span><span style=3D" color:#800080;"><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify">std</span></span><s=
pan style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-=
by-prettify">::</span></span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify">endl</span><span style=3D" color:#000000;"><span style=3D"color=
: #660;" class=3D"styled-by-prettify">;</span></span></pre><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"><br></span><pre><span style=3D" c=
olor:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify">&n=
bsp; &nbsp; &nbsp; &nbsp; </span></span><span style=3D" color:#800080;"><sp=
an style=3D"color: #606;" class=3D"styled-by-prettify">Foo</span></span><sp=
an style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> </span></span><span style=3D" color:#000000;"><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify">d</span></span><span style=3D" co=
lor:#000000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">(</=
span></span><span style=3D" color:#000080;"><span style=3D"color: #066;" cl=
ass=3D"styled-by-prettify">3</span></span><span style=3D" color:#000000;"><=
span style=3D"color: #660;" class=3D"styled-by-prettify">);</span></span></=
pre><pre><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> &nbsp; &nbsp; &nbsp; &nbsp;</span></span><span sty=
le=3D" color:#000000;"><span style=3D"color: #000;" class=3D"styled-by-pret=
tify">d</span></span><span style=3D" color:#c0c0c0;"><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> </span></span><span style=3D" color:#0=
00000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span=
></span><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span></span><span style=3D" color:#000000;"><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify">b</span></span><span =
style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">;</span></span></pre><pre><span style=3D" color:#c0c0c0;"><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> &nbsp; &nbsp; &nbsp; &nb=
sp;</span></span><span style=3D" color:#800080;"><span style=3D"color: #000=
;" class=3D"styled-by-prettify">std</span></span><span style=3D" color:#000=
000;"><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span></=
span><span style=3D"color: #000;" class=3D"styled-by-prettify">cout</span><=
span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled=
-by-prettify"> </span></span><span style=3D" color:#000000;"><span style=3D=
"color: #660;" class=3D"styled-by-prettify">&lt;&lt;</span></span><span sty=
le=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> </span></span><span style=3D" color:#000000;"><span style=3D"color: =
#000;" class=3D"styled-by-prettify">d</span></span><span style=3D" color:#c=
0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><=
/span><span style=3D" color:#000000;"><span style=3D"color: #660;" class=3D=
"styled-by-prettify">&lt;&lt;</span></span><span style=3D" color:#c0c0c0;">=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> </span></span><s=
pan style=3D" color:#008000;"><span style=3D"color: #080;" class=3D"styled-=
by-prettify">"</span></span><span style=3D" color:#c0c0c0;"><span style=3D"=
color: #080;" class=3D"styled-by-prettify"> </span></span><span style=3D" c=
olor:#008000;"><span style=3D"color: #080;" class=3D"styled-by-prettify">"<=
/span></span><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> </span></span><span style=3D" color:#000000;">=
<span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;&lt;</span></=
span><span style=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> </span></span><span style=3D" color:#000000;"><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify">b</span></span><span styl=
e=3D" color:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"> </span></span><span style=3D" color:#000000;"><span style=3D"color: #=
660;" class=3D"styled-by-prettify">&lt;&lt;</span></span><span style=3D" co=
lor:#c0c0c0;"><span style=3D"color: #000;" class=3D"styled-by-prettify"> </=
span></span><span style=3D" color:#800080;"><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify">std</span></span><span style=3D" color:#000000;"=
><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span></span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify">endl</span><span =
style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">;</span></span></pre><pre><span style=3D" color:#c0c0c0;"><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> &nbsp; &nbsp;</span></sp=
an><span style=3D" color:#000000;"><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">}</span></span></pre></div></code></div><div class=3D"pre=
ttyprint" style=3D"background-color: rgb(250, 250, 250); border: 1px solid =
rgb(187, 187, 187); word-wrap: break-word;"><code class=3D"prettyprint"><di=
v class=3D"subprettyprint"><div class=3D"subprettyprint"><font color=3D"#66=
0066">0x25216d0(1)</font></div><div class=3D"subprettyprint"><font color=3D=
"#660066">0x2521720(&amp;&amp;0x25216d0)</font></div><div class=3D"subprett=
yprint"><font color=3D"#660066">0x2521720~0x25216d0</font></div><div class=
=3D"subprettyprint"><font color=3D"#660066">0 1</font></div><div class=3D"s=
ubprettyprint"><font color=3D"#660066">0x2523b60(2)</font></div><div class=
=3D"subprettyprint"><font color=3D"#660066">0x2567d20(&amp;&amp;0x25216d0)<=
/font></div><div class=3D"subprettyprint"><font color=3D"#660066">0x2567d20=
~0x25216d0</font></div><div class=3D"subprettyprint"><font color=3D"#660066=
">0x2523b60=3D0x25216d0</font></div><div class=3D"subprettyprint"><font col=
or=3D"#660066">0x2523b60~0x25216d0</font></div><div class=3D"subprettyprint=
"><font color=3D"#660066">~0x2523b60</font></div><div class=3D"subprettypri=
nt"><font color=3D"#660066">1 0</font></div><div class=3D"subprettyprint"><=
font color=3D"#660066">0x2523b60(3)</font></div><div class=3D"subprettyprin=
t"><font color=3D"#660066">0x2568c20(&amp;0x2567d20)</font></div><div class=
=3D"subprettyprint"><font color=3D"#660066">0x2523b60=3D0x2568c20</font></d=
iv><div class=3D"subprettyprint"><font color=3D"#660066">0x2523b60~0x2568c2=
0</font></div><div class=3D"subprettyprint"><font color=3D"#660066">~0x2523=
b60</font></div><div class=3D"subprettyprint"><font color=3D"#660066">0 0</=
font></div><div class=3D"subprettyprint"><font color=3D"#660066">~0x2568c20=
</font></div><div class=3D"subprettyprint"><font color=3D"#660066">~0x25216=
d0</font></div><div class=3D"subprettyprint"><font color=3D"#660066">~0x256=
7d20</font></div><div class=3D"subprettyprint"><font color=3D"#660066">~0x2=
521720</font></div><div><br></div></div></code></div><br>As you can see her=
e there is a lot of code that can be copy and pasted to other classes basic=
ally.<br>Why do all this manually, unless in a special case that can be ove=
rloaded?&nbsp;I feel like this should be default behavior, like the copy co=
nstructor is.<div><br>In the current situation we have no guarantee that a =
class is swap-able or move-able. (Copies instead of swaps)<br>This guarante=
e however can make containers a lot more efficient as well &nbsp;when deali=
ng with large amounts of data that can basically be swapped.<br>I propose t=
he syntax a~b for, ::operator~(one, two) which is different from ::operator=
~(one). The ~ symbol kinda looks like a swapping symbol to me.<div><br>This=
 code should be the default behavior for all classes, internal types such a=
s int or pointers are all swap-able like classes with the ~ operator.<br>It=
 does the same thing as the default copy constructor except copying it does=
 swapping.<br><div class=3D"prettyprint" style=3D"background-color: rgb(250=
, 250, 250); border: 1px solid rgb(187, 187, 187); word-wrap: break-word;">=
<code class=3D"prettyprint"><div class=3D"subprettyprint"><pre><span style=
=3D"font-family: Arial, Helvetica, sans-serif; color: rgb(192, 192, 192);">=
&nbsp; &nbsp; </span><span style=3D"font-family: Arial, Helvetica, sans-ser=
if; color: rgb(128, 0, 128);">Foo</span><span style=3D"font-family: Arial, =
Helvetica, sans-serif; color: rgb(0, 0, 0);">&amp;</span><span style=3D"fon=
t-family: Arial, Helvetica, sans-serif; color: rgb(192, 192, 192);"> </span=
><span style=3D"font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0,=
 0);">operator~</span><span style=3D"font-family: Arial, Helvetica, sans-se=
rif; color: rgb(0, 0, 0);">(</span><span style=3D"font-family: Arial, Helve=
tica, sans-serif; color: rgb(128, 0, 128);">Foo</span><span style=3D"font-f=
amily: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0);">&amp;</span><spa=
n style=3D"font-family: Arial, Helvetica, sans-serif; color: rgb(192, 192, =
192);"> </span><span style=3D"font-family: Arial, Helvetica, sans-serif; co=
lor: rgb(0, 0, 0);">other</span><span style=3D"font-family: Arial, Helvetic=
a, sans-serif; color: rgb(0, 0, 0);">)</span><br></pre><pre><span style=3D"=
color: rgb(192, 192, 192);">&nbsp; &nbsp; </span><span style=3D"color: rgb(=
0, 0, 0);">{<br>        x ~ other.x; //int<br>        y ~ other.y; </span><=
span style=3D"color: rgb(102, 102, 0); font-family: Arial, Helvetica, sans-=
serif;">//int</span><span style=3D"color: rgb(0, 0, 0);"><br></span><span s=
tyle=3D"color: rgb(0, 0, 0);">        z ~ other.z; </span><span style=3D"co=
lor: rgb(102, 102, 0); font-family: Arial, Helvetica, sans-serif;">//int</s=
pan></pre><pre><span style=3D"color: rgb(192, 192, 192);"> &nbsp; &nbsp; &n=
bsp; &nbsp;</span><span style=3D"color: rgb(128, 0, 0);">ptr ~ </span><span=
 style=3D"color: rgb(0, 0, 0);">other</span><font color=3D"#666600">.</font=
><span style=3D"color: rgb(128, 0, 0);">ptr</span><span style=3D"color: rgb=
(0, 0, 0);">; // ptr to int<br>        bar ~ other.bar; // class Bar</span>=
</pre><pre><span style=3D"color: rgb(192, 192, 192);"> &nbsp; &nbsp;</span>=
<span style=3D"color: rgb(0, 0, 0);">}</span></pre></div></code></div><br>T=
he default copy constructor does not respect initialization, it might work =
for PODS but not for classes that take care of pointers or other data.<br><=
div><div class=3D"prettyprint" style=3D"background-color: rgb(250, 250, 250=
); border: 1px solid rgb(187, 187, 187); word-wrap: break-word;"><code clas=
s=3D"prettyprint"><div class=3D"subprettyprint"><p style=3D"margin-bottom: =
0px;"><span style=3D"font-family: Arial, Helvetica, sans-serif; color: rgb(=
192, 192, 192);">&nbsp; &nbsp; </span><span style=3D"font-family: Arial, He=
lvetica, sans-serif; color: rgb(128, 0, 128);">Foo</span><span style=3D"fon=
t-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0);">&amp;</span><=
span style=3D"font-family: Arial, Helvetica, sans-serif; color: rgb(192, 19=
2, 192);"> </span><span style=3D"font-family: Arial, Helvetica, sans-serif;=
 color: rgb(128, 128, 0);">operator</span><span style=3D"font-family: Arial=
, Helvetica, sans-serif; color: rgb(0, 0, 0);">=3D(</span><span style=3D"fo=
nt-family: Arial, Helvetica, sans-serif; color: rgb(128, 128, 0);">const</s=
pan><span style=3D"font-family: Arial, Helvetica, sans-serif; color: rgb(19=
2, 192, 192);"> </span><span style=3D"font-family: Arial, Helvetica, sans-s=
erif; color: rgb(128, 0, 128);">Foo</span><span style=3D"font-family: Arial=
, Helvetica, sans-serif; color: rgb(0, 0, 0);">&amp;</span><span style=3D"f=
ont-family: Arial, Helvetica, sans-serif; color: rgb(192, 192, 192);"> </sp=
an><span style=3D"font-family: Arial, Helvetica, sans-serif; color: rgb(0, =
0, 0);">other</span><span style=3D"font-family: Arial, Helvetica, sans-seri=
f; color: rgb(0, 0, 0);">)</span></p><pre><span style=3D" color:#c0c0c0;"> =
&nbsp; &nbsp;</span><span style=3D" color:#000000;">{</span></pre><pre><spa=
n style=3D" color:#c0c0c0;"> &nbsp; &nbsp; &nbsp; &nbsp;</span>x<span style=
=3D" color:#c0c0c0;"> </span><span style=3D" color:#000000;">=3D</span><spa=
n style=3D" color:#c0c0c0;"> </span><span style=3D" color:#000000;">other</=
span><span style=3D" color:#000000;">.</span>x<span style=3D" color:#000000=
;">;</span></pre><pre><span style=3D" color:#c0c0c0;"> &nbsp; &nbsp; &nbsp;=
 &nbsp;</span>y<span style=3D" color:#c0c0c0;"> </span><span style=3D" colo=
r:#000000;">=3D</span><span style=3D" color:#c0c0c0;"> </span><span style=
=3D" color:#000000;">other</span><span style=3D" color:#000000;">.</span>y<=
span style=3D" color:#000000;">;</span></pre><pre><span style=3D" color:#c0=
c0c0;"> &nbsp; &nbsp; &nbsp; &nbsp;</span>z<span style=3D" color:#c0c0c0;">=
 </span><span style=3D" color:#000000;">=3D</span><span style=3D" color:#c0=
c0c0;"> </span><span style=3D" color:#000000;">other</span><span style=3D" =
color:#000000;">.</span>z<span style=3D" color:#000000;">;</span></pre><pre=
><span style=3D" color:#c0c0c0;"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span s=
tyle=3D" color:#800000;">ptr</span><span style=3D" color:#c0c0c0;"> </span>=
<span style=3D" color:#000000;">=3D</span><span style=3D" color:#c0c0c0;"> =
</span><span style=3D" color:#000000;">other</span><span style=3D" color:#0=
00000;">.</span><span style=3D" color:#800000;">ptr</span><span style=3D" c=
olor:#000000;">;<br>        bar =3D other.bar;</span></pre><pre><span style=
=3D" color:#c0c0c0;"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style=3D" col=
or:#808000;">return</span><span style=3D" color:#c0c0c0;"> </span><span sty=
le=3D" color:#000000;">*</span><span style=3D" color:#808000;">this</span><=
span style=3D" color:#000000;">;</span></pre><pre><span style=3D" color:#c0=
c0c0;"> &nbsp; &nbsp;</span><span style=3D" color:#000000;">}</span></pre><=
pre><span style=3D" color:#c0c0c0;"> &nbsp; &nbsp;</span></pre></div></code=
></div><br>If we had an internal swap-ing mechanism the default behavior ca=
n easily be replaced with this code.<br>The copy constructor will work both=
 for PODS and classes that manage points or other data and respect data ini=
tialization.<br><div class=3D"prettyprint" style=3D"background-color: rgb(2=
50, 250, 250); border: 1px solid rgb(187, 187, 187); word-wrap: break-word;=
"><code class=3D"prettyprint"><div class=3D"subprettyprint"><pre><span styl=
e=3D" color:#c0c0c0;">&nbsp; &nbsp; </span><span style=3D" color:#800080;">=
Foo</span><span style=3D" color:#000000;">&amp;</span><span style=3D" color=
:#c0c0c0;"> </span><span style=3D" color:#000000;">operator</span><span sty=
le=3D" color:#000000;">=3D(</span><span style=3D" color:#800080;">Foo</span=
><span style=3D" color:#c0c0c0;"> </span><span style=3D" color:#000000;">ot=
her</span><span style=3D" color:#000000;">)</span></pre><pre><span style=3D=
" color:#c0c0c0;"> &nbsp; &nbsp;</span><span style=3D" color:#000000;">{</s=
pan></pre><pre><span style=3D" color:#c0c0c0;"> &nbsp; &nbsp; &nbsp; &nbsp;=
</span><span style=3D" color:#808000;">return</span><span style=3D" color:#=
c0c0c0;"> *this ~ other</span><span style=3D" color:#000000;">;</span></pre=
><pre><span style=3D" color:#c0c0c0;"> &nbsp; &nbsp;</span><span style=3D" =
color:#000000;">}</span></pre></div></code></div>or&nbsp;<br><div class=3D"=
prettyprint" style=3D"background-color: rgb(250, 250, 250); border: 1px sol=
id rgb(187, 187, 187); word-wrap: break-word;"><code class=3D"prettyprint">=
<div class=3D"subprettyprint"><pre><span style=3D"color: rgb(192, 192, 192)=
;">&nbsp; &nbsp; </span><span style=3D"color: rgb(128, 0, 128);">Foo</span>=
<span style=3D"color: rgb(0, 0, 0);">&amp;</span><span style=3D"color: rgb(=
192, 192, 192);"> </span><span style=3D"color: rgb(0, 0, 0);">operator</spa=
n><span style=3D"color: rgb(0, 0, 0);">=3D(const </span><span style=3D"colo=
r: rgb(128, 0, 128);">Foo&amp;</span><span style=3D"color: rgb(192, 192, 19=
2);"> </span><span style=3D"color: rgb(0, 0, 0);">other</span><span style=
=3D"color: rgb(0, 0, 0);">)</span></pre><pre><span style=3D"color: rgb(192,=
 192, 192);"> &nbsp; &nbsp;</span><span style=3D"color: rgb(0, 0, 0);">{</s=
pan></pre><pre><span style=3D"color: rgb(192, 192, 192);"> &nbsp; &nbsp; &n=
bsp; &nbsp;</span><span style=3D"color: rgb(128, 128, 0);">return</span><sp=
an style=3D"color: rgb(192, 192, 192);"> *this ~ Foo(other)</span><span sty=
le=3D"color: rgb(0, 0, 0);">;</span></pre><pre><span style=3D"color: rgb(19=
2, 192, 192);"> &nbsp; &nbsp;</span><span style=3D"color: rgb(0, 0, 0);">}<=
br><br></span><pre><span style=3D"color: rgb(192, 192, 192);">&nbsp; &nbsp;=
 </span><span style=3D"color: rgb(128, 0, 128);">Foo</span><span style=3D"c=
olor: rgb(0, 0, 0);">&amp;</span><span style=3D"color: rgb(192, 192, 192);"=
> </span><span style=3D"color: rgb(0, 0, 0);">operator</span><span style=3D=
"color: rgb(0, 0, 0);">=3D(</span><span style=3D"color: rgb(128, 0, 128);">=
Foo&amp;&amp;</span><span style=3D"color: rgb(192, 192, 192);"> </span><spa=
n style=3D"color: rgb(0, 0, 0);">other</span><span style=3D"color: rgb(0, 0=
, 0);">)</span></pre><pre><span style=3D"color: rgb(192, 192, 192);"> &nbsp=
; &nbsp;</span><span style=3D"color: rgb(0, 0, 0);">{</span></pre><pre><spa=
n style=3D"color: rgb(192, 192, 192);"> &nbsp; &nbsp; &nbsp; &nbsp;</span><=
span style=3D"color: rgb(128, 128, 0);">return</span><span style=3D"color: =
rgb(192, 192, 192);"> *this ~ other</span><span style=3D"color: rgb(0, 0, 0=
);">;</span></pre><pre><span style=3D"color: rgb(192, 192, 192);"> &nbsp; &=
nbsp;</span><span style=3D"color: rgb(0, 0, 0);">}</span></pre></pre></div>=
</code></div><br>The move constructor can have default behavior as well.<br=
><div class=3D"prettyprint" style=3D"background-color: rgb(250, 250, 250); =
border: 1px solid rgb(187, 187, 187); word-wrap: break-word;"><code class=
=3D"prettyprint"><div class=3D"subprettyprint"><pre><span style=3D"color: r=
gb(192, 192, 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(=
0, 0, 0);">&nbsp; &nbsp; </span></span><span style=3D"color: rgb(128, 0, 12=
8);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 0, 102);">=
Foo</span></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled=
-by-prettify" style=3D"color: rgb(102, 102, 0);">(</span></span><span style=
=3D"color: rgb(128, 0, 128);"><span class=3D"styled-by-prettify" style=3D"c=
olor: rgb(102, 0, 102);">Foo</span></span><span style=3D"color: rgb(0, 0, 0=
);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">&=
amp;&amp;</span></span><span style=3D"color: rgb(192, 192, 192);"><span cla=
ss=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span></span><sp=
an style=3D"color: rgb(0, 0, 0);">other</span><span style=3D"color: rgb(0, =
0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0)=
;">)</span></span></pre><pre><span style=3D"color: rgb(192, 192, 192);"><sp=
an class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> &nbsp; &nbs=
p;</span></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-=
by-prettify" style=3D"color: rgb(102, 102, 0);">{<br>        Foo::Foo(); //=
 default constructor</span></span></pre><pre><span style=3D"color: rgb(192,=
 192, 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0=
);"> &nbsp; &nbsp; &nbsp; &nbsp;*this ~ other;</span></span></pre><pre><spa=
n style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" s=
tyle=3D"color: rgb(0, 0, 0);"> &nbsp; &nbsp;</span></span><span style=3D"co=
lor: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(=
102, 102, 0);">}</span></span></pre><div><span style=3D"color: rgb(0, 0, 0)=
;"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);"><b=
r></span></span></div></div></code></div><br>Finally if we assume this impl=
emented the original class would look like this and still function the same=
, in a pointer safe manner.<br>Also containers can swap the object around e=
fficiently and neither the user code or the STL implementation has to worry=
 about the safety of the pointer or the copying large amounts of data due t=
o the lack of a move constructor or move operator.<br><div class=3D"prettyp=
rint" style=3D"background-color: rgb(250, 250, 250); border: 1px solid rgb(=
187, 187, 187); word-wrap: break-word;"><code class=3D"prettyprint"><div cl=
ass=3D"subprettyprint"><p style=3D"margin-bottom: 0px;"><span style=3D"font=
-family: Arial, Helvetica, sans-serif; color: rgb(128, 128, 0);"><span clas=
s=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 136);">class</span></spa=
n><span style=3D"font-family: Arial, Helvetica, sans-serif; color: rgb(192,=
 192, 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0=
);">&nbsp;</span></span><span style=3D"font-family: Arial, Helvetica, sans-=
serif; color: rgb(128, 0, 128);"><span class=3D"styled-by-prettify" style=
=3D"color: rgb(102, 0, 102);">Foo</span></span><span class=3D"styled-by-pre=
ttify" style=3D"color: rgb(0, 0, 0);"><br></span></p><pre><span style=3D"co=
lor: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(=
102, 102, 0);">{</span></span></pre><pre><span style=3D"color: rgb(128, 128=
, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 136);">=
public</span></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"sty=
led-by-prettify" style=3D"color: rgb(102, 102, 0);">:</span></span></pre><p=
re><span style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-pret=
tify" style=3D"color: rgb(0, 0, 0);"> &nbsp; &nbsp;</span></span><span styl=
e=3D"color: rgb(128, 0, 128);"><span class=3D"styled-by-prettify" style=3D"=
color: rgb(102, 0, 102);">Foo</span></span><span style=3D"color: rgb(0, 0, =
0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">=
()</span></span></pre><pre><span style=3D"color: rgb(192, 192, 192);"><span=
 class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> &nbsp; &nbsp;=
 &nbsp; &nbsp;</span></span><span style=3D"color: rgb(0, 0, 0);"><span clas=
s=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">:</span></span>=
<span style=3D"color: rgb(128, 0, 0);"><span class=3D"styled-by-prettify" s=
tyle=3D"color: rgb(0, 0, 0);">ptr</span></span><span style=3D"color: rgb(0,=
 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0=
);">(</span></span><span style=3D"color: rgb(128, 128, 0);"><span class=3D"=
styled-by-prettify" style=3D"color: rgb(0, 0, 136);">new</span></span><span=
 style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" st=
yle=3D"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: rgb(128, =
128, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 136)=
;">int</span></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"sty=
led-by-prettify" style=3D"color: rgb(102, 102, 0);">(</span></span><span st=
yle=3D"color: rgb(0, 0, 128);"><span class=3D"styled-by-prettify" style=3D"=
color: rgb(0, 102, 102);">0</span></span><span style=3D"color: rgb(0, 0, 0)=
;"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">))=
</span></span></pre><pre><span style=3D"color: rgb(192, 192, 192);"><span c=
lass=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> &nbsp; &nbsp;</=
span></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-p=
rettify" style=3D"color: rgb(102, 102, 0);">{</span></span></pre><pre><span=
 style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" st=
yle=3D"color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;</span></span><spa=
n style=3D"color: rgb(128, 0, 128);"><span class=3D"styled-by-prettify" sty=
le=3D"color: rgb(0, 0, 0);">std</span></span><span style=3D"color: rgb(0, 0=
, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);=
">::</span></span><span class=3D"styled-by-prettify" style=3D"color: rgb(0,=
 0, 0);">cout</span><span style=3D"color: rgb(192, 192, 192);"><span class=
=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span></span><span=
 style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D=
"color: rgb(102, 102, 0);">&lt;&lt;</span></span><span style=3D"color: rgb(=
192, 192, 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, =
0, 0);"> </span></span><span style=3D"color: rgb(128, 0, 0);"><span class=
=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);">ptr</span></span><sp=
an style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" =
style=3D"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: rgb(0, =
0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0)=
;">&lt;&lt;</span></span><span style=3D"color: rgb(192, 192, 192);"><span c=
lass=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span></span><=
span style=3D"color: rgb(0, 128, 0);"><span class=3D"styled-by-prettify" st=
yle=3D"color: rgb(0, 136, 0);">"()"</span></span><span style=3D"color: rgb(=
192, 192, 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, =
0, 0);"> </span></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"=
styled-by-prettify" style=3D"color: rgb(102, 102, 0);">&lt;&lt;</span></spa=
n><span style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prett=
ify" style=3D"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: rg=
b(128, 0, 128);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, =
0, 0);">std</span></span><span style=3D"color: rgb(0, 0, 0);"><span class=
=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">::</span></span>=
<span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);">endl</spa=
n><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" s=
tyle=3D"color: rgb(102, 102, 0);">;</span></span></pre><pre><span style=3D"=
color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" style=3D"col=
or: rgb(0, 0, 0);"> &nbsp; &nbsp;</span></span><span style=3D"color: rgb(0,=
 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0=
);">}</span></span></pre><pre><span class=3D"styled-by-prettify" style=3D"c=
olor: rgb(0, 0, 0);"><br></span></pre><pre><span style=3D"color: rgb(192, 1=
92, 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);=
">&nbsp; &nbsp; </span></span><span style=3D"color: rgb(128, 0, 128);"><spa=
n class=3D"styled-by-prettify" style=3D"color: rgb(102, 0, 102);">Foo</span=
></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prett=
ify" style=3D"color: rgb(102, 102, 0);">(</span></span><span style=3D"color=
: rgb(128, 128, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb=
(0, 0, 136);">int</span></span><span style=3D"color: rgb(192, 192, 192);"><=
span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span></=
span><span style=3D"color: rgb(0, 0, 0);">val</span><span style=3D"color: r=
gb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 1=
02, 0);">)</span></span></pre><pre><span style=3D"color: rgb(192, 192, 192)=
;"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> &nbsp=
; &nbsp; &nbsp; &nbsp;</span></span><span style=3D"color: rgb(0, 0, 0);"><s=
pan class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">:</span=
></span><span style=3D"color: rgb(128, 0, 0);"><span class=3D"styled-by-pre=
ttify" style=3D"color: rgb(0, 0, 0);">ptr</span></span><span style=3D"color=
: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102=
, 102, 0);">(</span></span><span style=3D"color: rgb(128, 128, 0);"><span c=
lass=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 136);">new</span></sp=
an><span style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-pret=
tify" style=3D"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: r=
gb(128, 128, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0,=
 0, 136);">int</span></span><span style=3D"color: rgb(0, 0, 0);"><span clas=
s=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">(</span></span>=
<span style=3D"color: rgb(0, 0, 0);">val</span><span style=3D"color: rgb(0,=
 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0=
);">))</span></span></pre><pre><span style=3D"color: rgb(192, 192, 192);"><=
span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> &nbsp; &n=
bsp;</span></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"style=
d-by-prettify" style=3D"color: rgb(102, 102, 0);">{</span></span></pre><pre=
><span style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-pretti=
fy" style=3D"color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;</span></spa=
n><span style=3D"color: rgb(128, 0, 128);"><span class=3D"styled-by-prettif=
y" style=3D"color: rgb(0, 0, 0);">std</span></span><span style=3D"color: rg=
b(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 10=
2, 0);">::</span></span><span class=3D"styled-by-prettify" style=3D"color: =
rgb(0, 0, 0);">cout</span><span style=3D"color: rgb(192, 192, 192);"><span =
class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span></span>=
<span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" sty=
le=3D"color: rgb(102, 102, 0);">&lt;&lt;</span></span><span style=3D"color:=
 rgb(192, 192, 192);"><span class=3D"styled-by-prettify" style=3D"color: rg=
b(0, 0, 0);"> </span></span><span style=3D"color: rgb(128, 0, 0);"><span cl=
ass=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);">ptr</span></span>=
<span style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettif=
y" style=3D"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: rgb(=
0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102,=
 0);">&lt;&lt;</span></span><span style=3D"color: rgb(192, 192, 192);"><spa=
n class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span></spa=
n><span style=3D"color: rgb(0, 128, 0);"><span class=3D"styled-by-prettify"=
 style=3D"color: rgb(0, 136, 0);">"("</span></span><span style=3D"color: rg=
b(192, 192, 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0=
, 0, 0);"> </span></span><span style=3D"color: rgb(0, 0, 0);"><span class=
=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">&lt;&lt;</span><=
/span><span style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-p=
rettify" style=3D"color: rgb(0, 0, 0);"> </span></span><span style=3D"color=
: rgb(0, 0, 0);">val</span><span style=3D"color: rgb(192, 192, 192);"><span=
 class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span></span=
><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" st=
yle=3D"color: rgb(102, 102, 0);">&lt;&lt;</span></span><span style=3D"color=
: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" style=3D"color: r=
gb(0, 0, 0);"> </span></span><span style=3D"color: rgb(0, 128, 0);"><span c=
lass=3D"styled-by-prettify" style=3D"color: rgb(0, 136, 0);">")"</span></sp=
an><span style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-pret=
tify" style=3D"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: r=
gb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 1=
02, 0);">&lt;&lt;</span></span><span style=3D"color: rgb(192, 192, 192);"><=
span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span></=
span><span style=3D"color: rgb(128, 0, 128);"><span class=3D"styled-by-pret=
tify" style=3D"color: rgb(0, 0, 0);">std</span></span><span style=3D"color:=
 rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102,=
 102, 0);">::</span></span><span class=3D"styled-by-prettify" style=3D"colo=
r: rgb(0, 0, 0);">endl</span><span style=3D"color: rgb(0, 0, 0);"><span cla=
ss=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">;</span></span=
></pre><pre><span style=3D"color: rgb(192, 192, 192);"><span class=3D"style=
d-by-prettify" style=3D"color: rgb(0, 0, 0);"> &nbsp; &nbsp;</span></span><=
span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" styl=
e=3D"color: rgb(102, 102, 0);">}</span></span></pre><pre><span class=3D"sty=
led-by-prettify" style=3D"color: rgb(0, 0, 0);"><br></span></pre><pre><span=
 style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" st=
yle=3D"color: rgb(0, 0, 0);">&nbsp; &nbsp; </span></span><span style=3D"col=
or: rgb(128, 0, 128);"><span class=3D"styled-by-prettify" style=3D"color: r=
gb(102, 0, 102);">Foo</span></span><span style=3D"color: rgb(0, 0, 0);"><sp=
an class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">(</span>=
</span><span style=3D"color: rgb(128, 128, 0);"><span class=3D"styled-by-pr=
ettify" style=3D"color: rgb(0, 0, 136);">const</span></span><span style=3D"=
color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" style=3D"col=
or: rgb(0, 0, 0);"> </span></span><span style=3D"color: rgb(128, 0, 128);">=
<span class=3D"styled-by-prettify" style=3D"color: rgb(102, 0, 102);">Foo</=
span></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-p=
rettify" style=3D"color: rgb(102, 102, 0);">&amp;</span></span><span style=
=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" style=3D=
"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: rgb(0, 0, 0);">=
other</span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-p=
rettify" style=3D"color: rgb(102, 102, 0);">)</span></span></pre><pre><span=
 style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" st=
yle=3D"color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;</span></span><spa=
n style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=
=3D"color: rgb(102, 102, 0);">:</span></span><span style=3D"color: rgb(128,=
 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);">=
ptr</span></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled=
-by-prettify" style=3D"color: rgb(102, 102, 0);">(</span></span><span style=
=3D"color: rgb(128, 128, 0);"><span class=3D"styled-by-prettify" style=3D"c=
olor: rgb(0, 0, 136);">new</span></span><span style=3D"color: rgb(192, 192,=
 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> =
</span></span><span style=3D"color: rgb(128, 128, 0);"><span class=3D"style=
d-by-prettify" style=3D"color: rgb(0, 0, 136);">int</span></span><span styl=
e=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"colo=
r: rgb(102, 102, 0);">(</span></span><span style=3D"color: rgb(0, 0, 0);">o=
ther</span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-pr=
ettify" style=3D"color: rgb(102, 102, 0);">))</span></span></pre><pre><span=
 style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" st=
yle=3D"color: rgb(0, 0, 0);"> &nbsp; &nbsp;</span></span><span style=3D"col=
or: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(1=
02, 102, 0);">{</span></span></pre><pre><span style=3D"color: rgb(192, 192,=
 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> =
&nbsp; &nbsp; &nbsp; &nbsp;</span></span><span style=3D"color: rgb(128, 0, =
128);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);">st=
d</span></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-b=
y-prettify" style=3D"color: rgb(102, 102, 0);">::</span></span><span class=
=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);">cout</span><span sty=
le=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" style=
=3D"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: rgb(0, 0, 0)=
;"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">&l=
t;&lt;</span></span><span style=3D"color: rgb(192, 192, 192);"><span class=
=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span></span><span=
 style=3D"color: rgb(128, 0, 0);"><span class=3D"styled-by-prettify" style=
=3D"color: rgb(0, 0, 0);">ptr</span></span><span style=3D"color: rgb(192, 1=
92, 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);=
"> </span></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled=
-by-prettify" style=3D"color: rgb(102, 102, 0);">&lt;&lt;</span></span><spa=
n style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" s=
tyle=3D"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: rgb(0, 1=
28, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 136, 0);=
">"(&amp;"</span></span><span style=3D"color: rgb(192, 192, 192);"><span cl=
ass=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span></span><s=
pan style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=
=3D"color: rgb(102, 102, 0);">&lt;&lt;</span></span><span style=3D"color: r=
gb(192, 192, 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(=
0, 0, 0);"> </span></span><span style=3D"color: rgb(0, 0, 0);">other</span>=
<span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" sty=
le=3D"color: rgb(102, 102, 0);">.</span></span><span style=3D"color: rgb(12=
8, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);=
">ptr</span></span><span style=3D"color: rgb(192, 192, 192);"><span class=
=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span></span><span=
 style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D=
"color: rgb(102, 102, 0);">&lt;&lt;</span></span><span style=3D"color: rgb(=
192, 192, 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, =
0, 0);"> </span></span><span style=3D"color: rgb(0, 128, 0);"><span class=
=3D"styled-by-prettify" style=3D"color: rgb(0, 136, 0);">")"</span></span><=
span style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify=
" style=3D"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: rgb(0=
, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, =
0);">&lt;&lt;</span></span><span style=3D"color: rgb(192, 192, 192);"><span=
 class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span></span=
><span style=3D"color: rgb(128, 0, 128);"><span class=3D"styled-by-prettify=
" style=3D"color: rgb(0, 0, 0);">std</span></span><span style=3D"color: rgb=
(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102=
, 0);">::</span></span><span class=3D"styled-by-prettify" style=3D"color: r=
gb(0, 0, 0);">endl</span><span style=3D"color: rgb(0, 0, 0);"><span class=
=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">;</span></span><=
/pre><pre><span style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-=
by-prettify" style=3D"color: rgb(0, 0, 0);"> &nbsp; &nbsp;</span></span><sp=
an style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=
=3D"color: rgb(102, 102, 0);">}</span></span></pre><pre><br></pre><pre><spa=
n style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" s=
tyle=3D"color: rgb(0, 0, 0);">&nbsp; &nbsp; </span></span><span style=3D"co=
lor: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(=
102, 102, 0);">~</span></span><span style=3D"color: rgb(128, 0, 128);"><spa=
n class=3D"styled-by-prettify" style=3D"color: rgb(102, 0, 102);">Foo</span=
></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prett=
ify" style=3D"color: rgb(102, 102, 0);">()</span></span></pre><pre><span st=
yle=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" style=
=3D"color: rgb(0, 0, 0);"> &nbsp; &nbsp;</span></span><span style=3D"color:=
 rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102,=
 102, 0);">{</span></span></pre><pre><span style=3D"color: rgb(192, 192, 19=
2);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> &nb=
sp; &nbsp; &nbsp; &nbsp;</span></span><span style=3D"color: rgb(128, 0, 128=
);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);">std</=
span></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-p=
rettify" style=3D"color: rgb(102, 102, 0);">::</span></span><span class=3D"=
styled-by-prettify" style=3D"color: rgb(0, 0, 0);">cout</span><span style=
=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" style=3D=
"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: rgb(0, 0, 0);">=
<span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">&lt;&=
lt;</span></span><span style=3D"color: rgb(192, 192, 192);"><span class=3D"=
styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span></span><span sty=
le=3D"color: rgb(0, 128, 0);"><span class=3D"styled-by-prettify" style=3D"c=
olor: rgb(0, 136, 0);">"~"</span></span><span style=3D"color: rgb(192, 192,=
 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> =
</span></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by=
-prettify" style=3D"color: rgb(102, 102, 0);">&lt;&lt;</span></span><span s=
tyle=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" styl=
e=3D"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: rgb(128, 0,=
 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);">ptr=
</span></span><span style=3D"color: rgb(192, 192, 192);"><span class=3D"sty=
led-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span></span><span style=
=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color=
: rgb(102, 102, 0);">&lt;&lt;</span></span><span style=3D"color: rgb(192, 1=
92, 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);=
"> </span></span><span style=3D"color: rgb(128, 0, 128);"><span class=3D"st=
yled-by-prettify" style=3D"color: rgb(0, 0, 0);">std</span></span><span sty=
le=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"col=
or: rgb(102, 102, 0);">::</span></span><span class=3D"styled-by-prettify" s=
tyle=3D"color: rgb(0, 0, 0);">endl</span><span style=3D"color: rgb(0, 0, 0)=
;"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">;<=
/span></span></pre><pre><span style=3D"color: rgb(192, 192, 192);"><span cl=
ass=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> &nbsp; &nbsp; &n=
bsp; &nbsp;</span></span><span style=3D"color: rgb(128, 128, 0);"><span cla=
ss=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 136);">delete</span></s=
pan><span style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-pre=
ttify" style=3D"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: =
rgb(128, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, =
0, 0);">ptr</span></span><span style=3D"color: rgb(0, 0, 0);"><span class=
=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">;</span></span><=
/pre><pre><span style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-=
by-prettify" style=3D"color: rgb(0, 0, 0);"> &nbsp; &nbsp;</span></span><sp=
an style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=
=3D"color: rgb(102, 102, 0);">}</span></span></pre><pre><br></pre><pre><spa=
n style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" s=
tyle=3D"color: rgb(0, 0, 0);">&nbsp; &nbsp; </span></span><span style=3D"co=
lor: rgb(128, 128, 0);"><span class=3D"styled-by-prettify" style=3D"color: =
rgb(0, 0, 136);">operator</span></span><span style=3D"color: rgb(192, 192, =
192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> <=
/span></span><span style=3D"color: rgb(128, 128, 0);"><span class=3D"styled=
-by-prettify" style=3D"color: rgb(0, 0, 136);">int</span></span><span style=
=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color=
: rgb(102, 102, 0);">()</span></span><span style=3D"color: rgb(192, 192, 19=
2);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </s=
pan></span><span style=3D"color: rgb(128, 128, 0);"><span class=3D"styled-b=
y-prettify" style=3D"color: rgb(0, 0, 136);">const</span></span></pre><pre>=
<span style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettif=
y" style=3D"color: rgb(0, 0, 0);"> &nbsp; &nbsp;</span></span><span style=
=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color=
: rgb(102, 102, 0);">{</span></span></pre><pre><span style=3D"color: rgb(19=
2, 192, 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0,=
 0);"> &nbsp; &nbsp; &nbsp; &nbsp;</span></span><span style=3D"color: rgb(1=
28, 128, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, =
136);">return</span></span><span style=3D"color: rgb(192, 192, 192);"><span=
 class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span></span=
><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" st=
yle=3D"color: rgb(102, 102, 0);">*</span></span><span style=3D"color: rgb(1=
28, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0)=
;">ptr</span></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"sty=
led-by-prettify" style=3D"color: rgb(102, 102, 0);">;</span></span></pre><p=
re><span style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-pret=
tify" style=3D"color: rgb(0, 0, 0);"> &nbsp; &nbsp;</span></span><span styl=
e=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"colo=
r: rgb(102, 102, 0);">}</span></span></pre><pre><span style=3D"font-family:=
 Arial, Helvetica, sans-serif; color: rgb(128, 128, 0);"><span class=3D"sty=
led-by-prettify" style=3D"color: rgb(0, 0, 136);">private</span></span><spa=
n style=3D"font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0);"=
><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">:</s=
pan></span><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);=
"><br></span></pre><pre><span style=3D"color: rgb(192, 192, 192);"><span cl=
ass=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);">&nbsp; &nbsp; </s=
pan></span><span style=3D"color: rgb(128, 128, 0);"><span class=3D"styled-b=
y-prettify" style=3D"color: rgb(0, 0, 136);">int</span></span><span style=
=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" style=3D=
"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: rgb(0, 0, 0);">=
<span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">*</sp=
an></span><span style=3D"color: rgb(128, 0, 0);"><span class=3D"styled-by-p=
rettify" style=3D"color: rgb(0, 0, 0);">ptr</span></span><span style=3D"col=
or: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(1=
02, 102, 0);">;</span></span></pre><pre><span style=3D"color: rgb(0, 0, 0);=
"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">};<=
/span></span></pre><div><pre><span style=3D"color: rgb(192, 192, 192);"><sp=
an class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"><br class=3D=
"Apple-interchange-newline">&nbsp; &nbsp; </span></span><span style=3D"colo=
r: rgb(128, 128, 0);"><span class=3D"styled-by-prettify" style=3D"color: rg=
b(0, 0, 136);">int</span></span><span style=3D"color: rgb(192, 192, 192);">=
<span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span><=
/span><span style=3D"color: rgb(0, 0, 0);">main</span><span style=3D"color:=
 rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102,=
 102, 0);">()</span></span></pre><pre><span style=3D"color: rgb(192, 192, 1=
92);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> &n=
bsp; &nbsp;</span></span><span style=3D"color: rgb(0, 0, 0);"><span class=
=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">{</span></span><=
/pre><pre><span style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-=
by-prettify" style=3D"color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;</s=
pan></span><span style=3D"color: rgb(128, 0, 128);"><span class=3D"styled-b=
y-prettify" style=3D"color: rgb(102, 0, 102);">Foo</span></span><span style=
=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" style=3D=
"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: rgb(0, 0, 0);">=
a</span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prett=
ify" style=3D"color: rgb(102, 102, 0);">(</span></span><span style=3D"color=
: rgb(0, 0, 128);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0=
, 102, 102);">1</span></span><span style=3D"color: rgb(0, 0, 0);"><span cla=
ss=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">);</span></spa=
n></pre><pre><span style=3D"color: rgb(192, 192, 192);"><span class=3D"styl=
ed-by-prettify" style=3D"color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;=
</span></span><span style=3D"color: rgb(128, 0, 128);"><span class=3D"style=
d-by-prettify" style=3D"color: rgb(102, 0, 102);">Foo</span></span><span st=
yle=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" style=
=3D"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: rgb(0, 0, 0)=
;">b</span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-pr=
ettify" style=3D"color: rgb(102, 102, 0);">(</span></span><span style=3D"co=
lor: rgb(128, 0, 128);"><span class=3D"styled-by-prettify" style=3D"color: =
rgb(0, 0, 0);">std</span></span><span style=3D"color: rgb(0, 0, 0);"><span =
class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">::</span></=
span><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);">move=
</span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-pretti=
fy" style=3D"color: rgb(102, 102, 0);">(</span></span><span style=3D"color:=
 rgb(0, 0, 0);">a</span><span style=3D"color: rgb(0, 0, 0);"><span class=3D=
"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">));</span></span></=
pre><pre><span style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-b=
y-prettify" style=3D"color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;</sp=
an></span><span style=3D"color: rgb(128, 0, 128);"><span class=3D"styled-by=
-prettify" style=3D"color: rgb(0, 0, 0);">std</span></span><span style=3D"c=
olor: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb=
(102, 102, 0);">::</span></span><span class=3D"styled-by-prettify" style=3D=
"color: rgb(0, 0, 0);">cout</span><span style=3D"color: rgb(192, 192, 192);=
"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span=
></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prett=
ify" style=3D"color: rgb(102, 102, 0);">&lt;&lt;</span></span><span style=
=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" style=3D=
"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: rgb(0, 0, 0);">=
a</span><span style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by=
-prettify" style=3D"color: rgb(0, 0, 0);"> </span></span><span style=3D"col=
or: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(1=
02, 102, 0);">&lt;&lt;</span></span><span style=3D"color: rgb(192, 192, 192=
);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </sp=
an></span><span style=3D"color: rgb(0, 128, 0);"><span class=3D"styled-by-p=
rettify" style=3D"color: rgb(0, 136, 0);">"</span></span><span style=3D"col=
or: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" style=3D"color:=
 rgb(0, 136, 0);"> </span></span><span style=3D"color: rgb(0, 128, 0);"><sp=
an class=3D"styled-by-prettify" style=3D"color: rgb(0, 136, 0);">"</span></=
span><span style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-pr=
ettify" style=3D"color: rgb(0, 0, 0);"> </span></span><span style=3D"color:=
 rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102,=
 102, 0);">&lt;&lt;</span></span><span style=3D"color: rgb(192, 192, 192);"=
><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span>=
</span><span style=3D"color: rgb(0, 0, 0);">b</span><span style=3D"color: r=
gb(192, 192, 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(=
0, 0, 0);"> </span></span><span style=3D"color: rgb(0, 0, 0);"><span class=
=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">&lt;&lt;</span><=
/span><span style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-p=
rettify" style=3D"color: rgb(0, 0, 0);"> </span></span><span style=3D"color=
: rgb(128, 0, 128);"><span class=3D"styled-by-prettify" style=3D"color: rgb=
(0, 0, 0);">std</span></span><span style=3D"color: rgb(0, 0, 0);"><span cla=
ss=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">::</span></spa=
n><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);">endl</s=
pan><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify"=
 style=3D"color: rgb(102, 102, 0);">;</span></span></pre><span class=3D"sty=
led-by-prettify" style=3D"color: rgb(0, 0, 0);"><br></span><pre><span style=
=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" style=3D=
"color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; </span></span><span styl=
e=3D"color: rgb(128, 0, 128);"><span class=3D"styled-by-prettify" style=3D"=
color: rgb(102, 0, 102);">Foo</span></span><span style=3D"color: rgb(192, 1=
92, 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);=
"> </span></span><span style=3D"color: rgb(0, 0, 0);">c</span><span style=
=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color=
: rgb(102, 102, 0);">(</span></span><span style=3D"color: rgb(0, 0, 128);">=
<span class=3D"styled-by-prettify" style=3D"color: rgb(0, 102, 102);">2</sp=
an></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-pre=
ttify" style=3D"color: rgb(102, 102, 0);">);</span></span></pre><pre><span =
style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" sty=
le=3D"color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;</span></span><span=
 style=3D"color: rgb(0, 0, 0);">c</span><span class=3D"styled-by-prettify" =
style=3D"color: rgb(0, 0, 0);"> </span><span class=3D"styled-by-prettify"><=
font color=3D"#666600">~ </font></span><span style=3D"color: rgb(0, 0, 0);"=
>b</span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-pret=
tify" style=3D"color: rgb(102, 102, 0);">;</span></span></pre><pre><span st=
yle=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" style=
=3D"color: rgb(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;</span></span><span s=
tyle=3D"color: rgb(128, 0, 128);"><span class=3D"styled-by-prettify" style=
=3D"color: rgb(0, 0, 0);">std</span></span><span style=3D"color: rgb(0, 0, =
0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">=
::</span></span><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0=
, 0);">cout</span><span style=3D"color: rgb(192, 192, 192);"><span class=3D=
"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span></span><span st=
yle=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"co=
lor: rgb(102, 102, 0);">&lt;&lt;</span></span><span style=3D"color: rgb(192=
, 192, 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, =
0);"> </span></span><span style=3D"color: rgb(0, 0, 0);">c</span><span styl=
e=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" style=
=3D"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: rgb(0, 0, 0)=
;"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">&l=
t;&lt;</span></span><span style=3D"color: rgb(192, 192, 192);"><span class=
=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span></span><span=
 style=3D"color: rgb(0, 128, 0);"><span class=3D"styled-by-prettify" style=
=3D"color: rgb(0, 136, 0);">"</span></span><span style=3D"color: rgb(192, 1=
92, 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 136, 0=
);"> </span></span><span style=3D"color: rgb(0, 128, 0);"><span class=3D"st=
yled-by-prettify" style=3D"color: rgb(0, 136, 0);">"</span></span><span sty=
le=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" style=
=3D"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: rgb(0, 0, 0)=
;"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">&l=
t;&lt;</span></span><span style=3D"color: rgb(192, 192, 192);"><span class=
=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span></span><span=
 style=3D"color: rgb(0, 0, 0);">b</span><span style=3D"color: rgb(192, 192,=
 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> =
</span></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by=
-prettify" style=3D"color: rgb(102, 102, 0);">&lt;&lt;</span></span><span s=
tyle=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify" styl=
e=3D"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: rgb(128, 0,=
 128);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);">s=
td</span></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-=
by-prettify" style=3D"color: rgb(102, 102, 0);">::</span></span><span class=
=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);">endl</span><span sty=
le=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"col=
or: rgb(102, 102, 0);">;</span></span></pre><span class=3D"styled-by-pretti=
fy" style=3D"color: rgb(0, 0, 0);"><br></span><pre><span style=3D"color: rg=
b(192, 192, 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0=
, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; </span></span><span style=3D"color: r=
gb(128, 0, 128);"><span class=3D"styled-by-prettify" style=3D"color: rgb(10=
2, 0, 102);">Foo</span></span><span style=3D"color: rgb(192, 192, 192);"><s=
pan class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span></s=
pan><span style=3D"color: rgb(0, 0, 0);">d</span><span style=3D"color: rgb(=
0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102,=
 0);">(</span></span><span style=3D"color: rgb(0, 0, 128);"><span class=3D"=
styled-by-prettify" style=3D"color: rgb(0, 102, 102);">3</span></span><span=
 style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D=
"color: rgb(102, 102, 0);">);</span></span></pre><pre><span style=3D"color:=
 rgb(192, 192, 192);"><span class=3D"styled-by-prettify" style=3D"color: rg=
b(0, 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;</span></span><span style=3D"color=
: rgb(0, 0, 0);">d</span><span style=3D"color: rgb(192, 192, 192);"><span c=
lass=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span></span><=
span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" styl=
e=3D"color: rgb(102, 102, 0);">=3D</span></span><span style=3D"color: rgb(1=
92, 192, 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0=
, 0);"> </span></span><span style=3D"color: rgb(0, 0, 0);">b</span><span st=
yle=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"co=
lor: rgb(102, 102, 0);">;</span></span></pre><pre><span style=3D"color: rgb=
(192, 192, 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0,=
 0, 0);"> &nbsp; &nbsp; &nbsp; &nbsp;</span></span><span style=3D"color: rg=
b(128, 0, 128);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, =
0, 0);">std</span></span><span style=3D"color: rgb(0, 0, 0);"><span class=
=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">::</span></span>=
<span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);">cout</spa=
n><span style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prett=
ify" style=3D"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: rg=
b(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 10=
2, 0);">&lt;&lt;</span></span><span style=3D"color: rgb(192, 192, 192);"><s=
pan class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span></s=
pan><span style=3D"color: rgb(0, 0, 0);">d</span><span style=3D"color: rgb(=
192, 192, 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, =
0, 0);"> </span></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"=
styled-by-prettify" style=3D"color: rgb(102, 102, 0);">&lt;&lt;</span></spa=
n><span style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prett=
ify" style=3D"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: rg=
b(0, 128, 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 13=
6, 0);">"</span></span><span style=3D"color: rgb(192, 192, 192);"><span cla=
ss=3D"styled-by-prettify" style=3D"color: rgb(0, 136, 0);"> </span></span><=
span style=3D"color: rgb(0, 128, 0);"><span class=3D"styled-by-prettify" st=
yle=3D"color: rgb(0, 136, 0);">"</span></span><span style=3D"color: rgb(192=
, 192, 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, =
0);"> </span></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"sty=
led-by-prettify" style=3D"color: rgb(102, 102, 0);">&lt;&lt;</span></span><=
span style=3D"color: rgb(192, 192, 192);"><span class=3D"styled-by-prettify=
" style=3D"color: rgb(0, 0, 0);"> </span></span><span style=3D"color: rgb(0=
, 0, 0);">b</span><span style=3D"color: rgb(192, 192, 192);"><span class=3D=
"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> </span></span><span st=
yle=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"co=
lor: rgb(102, 102, 0);">&lt;&lt;</span></span><span style=3D"color: rgb(192=
, 192, 192);"><span class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, =
0);"> </span></span><span style=3D"color: rgb(128, 0, 128);"><span class=3D=
"styled-by-prettify" style=3D"color: rgb(0, 0, 0);">std</span></span><span =
style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by-prettify" style=3D"=
color: rgb(102, 102, 0);">::</span></span><span class=3D"styled-by-prettify=
" style=3D"color: rgb(0, 0, 0);">endl</span><span style=3D"color: rgb(0, 0,=
 0);"><span class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);"=
>;</span></span></pre><pre><span style=3D"color: rgb(192, 192, 192);"><span=
 class=3D"styled-by-prettify" style=3D"color: rgb(0, 0, 0);"> &nbsp; &nbsp;=
</span></span><span style=3D"color: rgb(0, 0, 0);"><span class=3D"styled-by=
-prettify" style=3D"color: rgb(102, 102, 0);">}</span></span></pre></div></=
div></code></div><br><br></div></div></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_4000_25336262.1394912386337--

.


Author: Philipp Maximilian Stephani <p.stephani2@gmail.com>
Date: Sun, 16 Mar 2014 15:19:57 +0000
Raw View
--047d7b675bf0002c5f04f4bad6cf
Content-Type: text/plain; charset=UTF-8

A swap operator has already been proposed in
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3746.pdf. Please
discuss that proposal first before making a new one.

On Sat Mar 15 2014 at 20:39:48, Christ-Jan Wijtmans <cj.wijtmans@gmail.com>
wrote:

> Hello dear good Sir or Madam,
>
> Some about me:
> I have 13 years of experience in C++, i started out at 10-11 years old.
> C++11 has inspired me to suggest some useful and improving features.
>
> The experience and annoyance:
> Currently i am in a huge project of mine and i believe it might reach at
> least 30 classes.
> That is really hard to maintain, especially now that we have rvalue
> references, which i believe is an ingenious invention to solve the temp
> objects issue.
> However, making sure that so many classes have proper copy operators and
> constructors and now in addition rvalue reference operators and
> constructors is just a pain to maintain.
> Also i noticed that it boils down to duplicated code, that is basically
> the same.
>
> To the point(issue):
> A proper class that is swap-able and move-able in c++11 looks a lot like
> this.
>
> #include <iostream>
> class Foo
>
> {
>
> public:
>
>     Foo()
>
>         :ptr(new int(0))
>
>     {
>
>         std::cout << ptr << "()" << std::endl;
>
>     }
>
>
>     Foo(int val)
>
>         :ptr(new int(val))
>
>     {
>
>         std::cout << ptr << "(" << val << ")" << std::endl;
>
>     }
>
>
>     Foo(const Foo& other)
>
>         :ptr(new int(other))
>
>     {
>
>         std::cout << ptr << "(&" << other.ptr << ")" << std::endl;
>
>     }
>
>
>     Foo(Foo&& other)
>
>         :ptr(new int (0))
>
>     {
>
>         std::cout << ptr << "(&&" << other.ptr << ")" << std::endl;
>
>         swap(other);
>
>     }
>
>
>     ~Foo()
>
>     {
>
>         std::cout << "~" << ptr << std::endl;
>
>         delete ptr;
>
>     }
>
>
>     Foo& operator=(Foo other)
>
>     {
>
>         std::cout << ptr << "=" << other.ptr << std::endl;
>
>         return swap(other);
>
>     }
>
>
>     operator int() const
>
>     {
>
>         return *ptr;
>
>     }
>
>
>     Foo& swap(Foo& other)
>
>     {
>
>         std::cout << ptr << "~" << other.ptr << std::endl;
>
>         std::swap(ptr, other.ptr);
>
>     }
>
> private:
>
>     int *ptr;
>
> };
>
>
>     int main()
>
>     {
>
>         Foo a(1);
>
>         Foo b(std::move(a));
>
>         std::cout << a << " " << b << std::endl;
>
>
>         Foo c(2);
>
>         c = std::move(b);
>
>         std::cout << c << " " << b << std::endl;
>
>
>         Foo d(3);
>
>         d = b;
>
>         std::cout << d << " " << b << std::endl;
>
>     }
>
> 0x25216d0(1)
> 0x2521720(&&0x25216d0)
> 0x2521720~0x25216d0
> 0 1
> 0x2523b60(2)
> 0x2567d20(&&0x25216d0)
> 0x2567d20~0x25216d0
> 0x2523b60=0x25216d0
> 0x2523b60~0x25216d0
> ~0x2523b60
> 1 0
> 0x2523b60(3)
> 0x2568c20(&0x2567d20)
> 0x2523b60=0x2568c20
> 0x2523b60~0x2568c20
> ~0x2523b60
> 0 0
> ~0x2568c20
> ~0x25216d0
> ~0x2567d20
> ~0x2521720
>
>
> As you can see here there is a lot of code that can be copy and pasted to
> other classes basically.
> Why do all this manually, unless in a special case that can be
> overloaded? I feel like this should be default behavior, like the copy
> constructor is.
>
> In the current situation we have no guarantee that a class is swap-able or
> move-able. (Copies instead of swaps)
> This guarantee however can make containers a lot more efficient as well
>  when dealing with large amounts of data that can basically be swapped.
> I propose the syntax a~b for, ::operator~(one, two) which is different
> from ::operator~(one). The ~ symbol kinda looks like a swapping symbol to
> me.
>
> This code should be the default behavior for all classes, internal types
> such as int or pointers are all swap-able like classes with the ~ operator.
> It does the same thing as the default copy constructor except copying it
> does swapping.
>
>     Foo& operator~(Foo& other)
>
>     {
>         x ~ other.x; //int
>         y ~ other.y; //int
>         z ~ other.z; //int
>
>         ptr ~ other.ptr; // ptr to int
>         bar ~ other.bar; // class Bar
>
>     }
>
>
> The default copy constructor does not respect initialization, it might
> work for PODS but not for classes that take care of pointers or other data.
>
>     Foo& operator=(const Foo& other)
>
>     {
>
>         x = other.x;
>
>         y = other.y;
>
>         z = other.z;
>
>         ptr = other.ptr;
>         bar = other.bar;
>
>         return *this;
>
>     }
>
>
>
>
> If we had an internal swap-ing mechanism the default behavior can easily
> be replaced with this code.
> The copy constructor will work both for PODS and classes that manage
> points or other data and respect data initialization.
>
>     Foo& operator=(Foo other)
>
>     {
>
>         return *this ~ other;
>
>     }
>
> or
>
>     Foo& operator=(const Foo& other)
>
>     {
>
>         return *this ~ Foo(other);
>
>     }
>
>     Foo& operator=(Foo&& other)
>
>     {
>
>         return *this ~ other;
>
>     }
>
>
> The move constructor can have default behavior as well.
>
>     Foo(Foo&& other)
>
>     {
>         Foo::Foo(); // default constructor
>
>         *this ~ other;
>
>     }
>
>
>
> Finally if we assume this implemented the original class would look like
> this and still function the same, in a pointer safe manner.
> Also containers can swap the object around efficiently and neither the
> user code or the STL implementation has to worry about the safety of the
> pointer or the copying large amounts of data due to the lack of a move
> constructor or move operator.
>
> class Foo
>
> {
>
> public:
>
>     Foo()
>
>         :ptr(new int(0))
>
>     {
>
>         std::cout << ptr << "()" << std::endl;
>
>     }
>
>
>     Foo(int val)
>
>         :ptr(new int(val))
>
>     {
>
>         std::cout << ptr << "(" << val << ")" << std::endl;
>
>     }
>
>
>     Foo(const Foo& other)
>
>         :ptr(new int(other))
>
>     {
>
>         std::cout << ptr << "(&" << other.ptr << ")" << std::endl;
>
>     }
>
>
>     ~Foo()
>
>     {
>
>         std::cout << "~" << ptr << std::endl;
>
>         delete ptr;
>
>     }
>
>
>     operator int() const
>
>     {
>
>         return *ptr;
>
>     }
>
> private:
>
>     int *ptr;
>
> };
>
>
>     int main()
>
>     {
>
>         Foo a(1);
>
>         Foo b(std::move(a));
>
>         std::cout << a << " " << b << std::endl;
>
>
>         Foo c(2);
>
>         c ~ b;
>
>         std::cout << c << " " << b << std::endl;
>
>
>

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--047d7b675bf0002c5f04f4bad6cf
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

A swap operator has already been proposed in=C2=A0<a href=3D"http://www.ope=
n-std.org/jtc1/sc22/wg21/docs/papers/2013/n3746.pdf">http://www.open-std.or=
g/jtc1/sc22/wg21/docs/papers/2013/n3746.pdf</a>. Please discuss that propos=
al first before making a new one.<br>
<br><div>On Sat Mar 15 2014 at 20:39:48, Christ-Jan Wijtmans &lt;<a href=3D=
"mailto:cj.wijtmans@gmail.com">cj.wijtmans@gmail.com</a>&gt; wrote:</div><b=
lockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px =
#ccc solid;padding-left:1ex">
<div dir=3D"ltr">Hello dear good Sir or Madam,<br><br>Some about me:<br>I h=
ave 13 years of experience in C++, i started out at 10-11 years old. C++11 =
has inspired me to suggest some useful and improving features.<br><br>The e=
xperience and annoyance:<br>
Currently i am in a huge project of mine and i believe it might reach at le=
ast 30 classes.<br>That is really hard to maintain, especially now that we =
have rvalue references, which i believe is an ingenious invention to solve =
the temp objects issue.<br>
However, making sure that so many classes have proper copy operators and co=
nstructors and now in addition rvalue reference operators and constructors =
is just a pain to maintain.<br>Also i noticed that it boils down to duplica=
ted code, that is basically the same.<br>
<br>To the point(issue):<br>A proper class that is swap-able and move-able =
in c++11 looks a lot like this.<br><div style=3D"background-color:rgb(250,2=
50,250);border:1px solid rgb(187,187,187);word-wrap:break-word"><code><div>
<p style=3D"margin-bottom:0px"><span style=3D"font-family:Arial,Helvetica,s=
ans-serif;color:rgb(128,128,0)"><span style=3D"color:#800">#include</span><=
span style=3D"color:#000"> </span><span style=3D"color:#080">&lt;iostream&g=
t;</span><span style=3D"color:#000"><br>
</span><span style=3D"color:#008">class</span></span><span style=3D"font-fa=
mily:Arial,Helvetica,sans-serif;color:rgb(192,192,192)"><span style=3D"colo=
r:#000"> </span></span><span style=3D"font-family:Arial,Helvetica,sans-seri=
f;color:rgb(128,0,128)"><span style=3D"color:#606">Foo</span></span><span s=
tyle><br>
</span></p><pre><span style><span style=3D"color:#660">{</span></span></pre=
><pre><span style=3D"color:#808000"><span style=3D"color:#008">public</span=
></span><span style><span style=3D"color:#660">:</span></span></pre><pre><s=
pan style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=A0</span=
></span><span style=3D"color:#800080"><span style=3D"color:#606">Foo</span>=
</span><span style><span style=3D"color:#660">()</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0 =C2=A0 =C2=A0</span></span><span style><span style=3D"color:#660">:</sp=
an></span><span style=3D"color:#800000"><span style=3D"color:#000">ptr</spa=
n></span><span style><span style=3D"color:#660">(</span></span><span style=
=3D"color:#808000"><span style=3D"color:#008">new</span></span><span style=
=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><span style=3D=
"color:#808000"><span style=3D"color:#008">int</span></span><span style><sp=
an style=3D"color:#660">(</span></span><span style=3D"color:#000080"><span =
style=3D"color:#066">0</span></span><span style><span style=3D"color:#660">=
))</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0</span></span><span style><span style=3D"color:#660">{</span></span></pr=
e><pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0 =C2=A0 =C2=A0</span></span><span style=3D"color:#800080"><span style=3D=
"color:#000">std</span></span><span style><span style=3D"color:#660">::</sp=
an></span><span style>cout</span><span style=3D"color:#c0c0c0"><span style=
=3D"color:#000"> </span></span><span style><span style=3D"color:#660">&lt;&=
lt;</span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =
</span></span><span style=3D"color:#800000"><span style=3D"color:#000">ptr<=
/span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </sp=
an></span><span style><span style=3D"color:#660">&lt;&lt;</span></span><spa=
n style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><span s=
tyle=3D"color:#008000"><span style=3D"color:#080">&quot;()&quot;</span></sp=
an><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span>=
<span style><span style=3D"color:#660">&lt;&lt;</span></span><span style=3D=
"color:#c0c0c0"><span style=3D"color:#000"> </span></span><span style=3D"co=
lor:#800080"><span style=3D"color:#000">std</span></span><span style><span =
style=3D"color:#660">::</span></span><span style>endl</span><span style><sp=
an style=3D"color:#660">;</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0</span></span><span style><span style=3D"color:#660">}</span></span></pr=
e><pre><span style><br></span></pre><pre><span style=3D"color:#c0c0c0"><spa=
n style=3D"color:#000">=C2=A0 =C2=A0 </span></span><span style=3D"color:#80=
0080"><span style=3D"color:#606">Foo</span></span><span style><span style=
=3D"color:#660">(</span></span><span style=3D"color:#808000"><span style=3D=
"color:#008">int</span></span><span style=3D"color:#c0c0c0"><span style=3D"=
color:#000"> </span></span><span style><span style>val</span></span><span s=
tyle><span style=3D"color:#660">)</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0 =C2=A0 =C2=A0</span></span><span style><span style=3D"color:#660">:</sp=
an></span><span style=3D"color:#800000"><span style=3D"color:#000">ptr</spa=
n></span><span style><span style=3D"color:#660">(</span></span><span style=
=3D"color:#808000"><span style=3D"color:#008">new</span></span><span style=
=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><span style=3D=
"color:#808000"><span style=3D"color:#008">int</span></span><span style><sp=
an style=3D"color:#660">(</span></span><span style><span style>val</span></=
span><span style><span style=3D"color:#660">))</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0</span></span><span style><span style=3D"color:#660">{</span></span></pr=
e><pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0 =C2=A0 =C2=A0</span></span><span style=3D"color:#800080"><span style=3D=
"color:#000">std</span></span><span style><span style=3D"color:#660">::</sp=
an></span><span style>cout</span><span style=3D"color:#c0c0c0"><span style=
=3D"color:#000"> </span></span><span style><span style=3D"color:#660">&lt;&=
lt;</span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =
</span></span><span style=3D"color:#800000"><span style=3D"color:#000">ptr<=
/span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </sp=
an></span><span style><span style=3D"color:#660">&lt;&lt;</span></span><spa=
n style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><span s=
tyle=3D"color:#008000"><span style=3D"color:#080">&quot;(&quot;</span></spa=
n><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><=
span style><span style=3D"color:#660">&lt;&lt;</span></span><span style=3D"=
color:#c0c0c0"><span style=3D"color:#000"> </span></span><span style><span =
style>val</span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#=
000"> </span></span><span style><span style=3D"color:#660">&lt;&lt;</span><=
/span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></sp=
an><span style=3D"color:#008000"><span style=3D"color:#080">&quot;)&quot;</=
span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </spa=
n></span><span style><span style=3D"color:#660">&lt;&lt;</span></span><span=
 style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><span st=
yle=3D"color:#800080"><span style=3D"color:#000">std</span></span><span sty=
le><span style=3D"color:#660">::</span></span><span style>endl</span><span =
style><span style=3D"color:#660">;</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0</span></span><span style><span style=3D"color:#660">}</span></span></pr=
e><pre><span style><br></span></pre><pre><span style=3D"color:#c0c0c0"><spa=
n style=3D"color:#000">=C2=A0 =C2=A0 </span></span><span style=3D"color:#80=
0080"><span style=3D"color:#606">Foo</span></span><span style><span style=
=3D"color:#660">(</span></span><span style=3D"color:#808000"><span style=3D=
"color:#008">const</span></span><span style=3D"color:#c0c0c0"><span style=
=3D"color:#000"> </span></span><span style=3D"color:#800080"><span style=3D=
"color:#606">Foo</span></span><span style><span style=3D"color:#660">&amp;<=
/span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </sp=
an></span><span style><span style>other</span></span><span style><span styl=
e=3D"color:#660">)</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0 =C2=A0 =C2=A0</span></span><span style><span style=3D"color:#660">:</sp=
an></span><span style=3D"color:#800000"><span style=3D"color:#000">ptr</spa=
n></span><span style><span style=3D"color:#660">(</span></span><span style=
=3D"color:#808000"><span style=3D"color:#008">new</span></span><span style=
=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><span style=3D=
"color:#808000"><span style=3D"color:#008">int</span></span><span style><sp=
an style=3D"color:#660">(</span></span><span style><span style>other</span>=
</span><span style><span style=3D"color:#660">))</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0</span></span><span style><span style=3D"color:#660">{</span></span></pr=
e><pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0 =C2=A0 =C2=A0</span></span><span style=3D"color:#800080"><span style=3D=
"color:#000">std</span></span><span style><span style=3D"color:#660">::</sp=
an></span><span style>cout</span><span style=3D"color:#c0c0c0"><span style=
=3D"color:#000"> </span></span><span style><span style=3D"color:#660">&lt;&=
lt;</span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =
</span></span><span style=3D"color:#800000"><span style=3D"color:#000">ptr<=
/span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </sp=
an></span><span style><span style=3D"color:#660">&lt;&lt;</span></span><spa=
n style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><span s=
tyle=3D"color:#008000"><span style=3D"color:#080">&quot;(&amp;&quot;</span>=
</span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></s=
pan><span style><span style=3D"color:#660">&lt;&lt;</span></span><span styl=
e=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><span style><=
span style>other</span></span><span style><span style=3D"color:#660">.</spa=
n></span><span style=3D"color:#800000"><span style=3D"color:#000">ptr</span=
></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></=
span><span style><span style=3D"color:#660">&lt;&lt;</span></span><span sty=
le=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><span style=
=3D"color:#008000"><span style=3D"color:#080">&quot;)&quot;</span></span><s=
pan style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><span=
 style><span style=3D"color:#660">&lt;&lt;</span></span><span style=3D"colo=
r:#c0c0c0"><span style=3D"color:#000"> </span></span><span style=3D"color:#=
800080"><span style=3D"color:#000">std</span></span><span style><span style=
=3D"color:#660">::</span></span><span style>endl</span><span style><span st=
yle=3D"color:#660">;</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0</span></span><span style><span style=3D"color:#660">}</span></span></pr=
e><pre><span style><br></span></pre><pre><span style=3D"color:#c0c0c0"><spa=
n style=3D"color:#000">=C2=A0 =C2=A0 </span></span><span style=3D"color:#80=
0080"><span style=3D"color:#606">Foo</span></span><span style><span style=
=3D"color:#660">(</span></span><span style=3D"color:#800080"><span style=3D=
"color:#606">Foo</span></span><span style><span style=3D"color:#660">&amp;&=
amp;</span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000">=
 </span></span><span style><span style>other</span></span><span style><span=
 style=3D"color:#660">)</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0 =C2=A0 =C2=A0</span></span><span style><span style=3D"color:#660">:</sp=
an></span><span style=3D"color:#800000"><span style=3D"color:#000">ptr</spa=
n></span><span style><span style=3D"color:#660">(</span></span><span style=
=3D"color:#808000"><span style=3D"color:#008">new</span></span><span style=
=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><span style=3D=
"color:#808000"><span style=3D"color:#008">int</span></span><span style=3D"=
color:#c0c0c0"><span style=3D"color:#000"> </span></span><span style><span =
style=3D"color:#660">(</span></span><span style=3D"color:#000080"><span sty=
le=3D"color:#066">0</span></span><span style><span style=3D"color:#660">))<=
/span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0</span></span><span style><span style=3D"color:#660">{</span></span></pr=
e><pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0 =C2=A0 =C2=A0</span></span><span style=3D"color:#800080"><span style=3D=
"color:#000">std</span></span><span style><span style=3D"color:#660">::</sp=
an></span><span style>cout</span><span style=3D"color:#c0c0c0"><span style=
=3D"color:#000"> </span></span><span style><span style=3D"color:#660">&lt;&=
lt;</span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =
</span></span><span style=3D"color:#800000"><span style=3D"color:#000">ptr<=
/span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </sp=
an></span><span style><span style=3D"color:#660">&lt;&lt;</span></span><spa=
n style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><span s=
tyle=3D"color:#008000"><span style=3D"color:#080">&quot;(&amp;&amp;&quot;</=
span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </spa=
n></span><span style><span style=3D"color:#660">&lt;&lt;</span></span><span=
 style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><span st=
yle><span style>other</span></span><span style><span style=3D"color:#660">.=
</span></span><span style=3D"color:#800000"><span style=3D"color:#000">ptr<=
/span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </sp=
an></span><span style><span style=3D"color:#660">&lt;&lt;</span></span><spa=
n style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><span s=
tyle=3D"color:#008000"><span style=3D"color:#080">&quot;)&quot;</span></spa=
n><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><=
span style><span style=3D"color:#660">&lt;&lt;</span></span><span style=3D"=
color:#c0c0c0"><span style=3D"color:#000"> </span></span><span style=3D"col=
or:#800080"><span style=3D"color:#000">std</span></span><span style><span s=
tyle=3D"color:#660">::</span></span><span style>endl</span><span style><spa=
n style=3D"color:#660">;</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0 =C2=A0 =C2=A0</span></span><span style><span style>swap</span></span><s=
pan style><span style=3D"color:#660">(</span></span><span style><span style=
>other</span></span><span style><span style=3D"color:#660">);</span></span>=
</pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0</span></span><span style><span style=3D"color:#660">}</span></span></pr=
e><pre><span style><br></span></pre><pre><span style=3D"color:#c0c0c0"><spa=
n style=3D"color:#000">=C2=A0 =C2=A0 </span></span><span style><span style=
=3D"color:#660">~</span></span><span style=3D"color:#800080"><span style=3D=
"color:#606">Foo</span></span><span style><span style=3D"color:#660">()</sp=
an></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0</span></span><span style><span style=3D"color:#660">{</span></span></pr=
e><pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0 =C2=A0 =C2=A0</span></span><span style=3D"color:#800080"><span style=3D=
"color:#000">std</span></span><span style><span style=3D"color:#660">::</sp=
an></span><span style>cout</span><span style=3D"color:#c0c0c0"><span style=
=3D"color:#000"> </span></span><span style><span style=3D"color:#660">&lt;&=
lt;</span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =
</span></span><span style=3D"color:#008000"><span style=3D"color:#080">&quo=
t;~&quot;</span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#=
000"> </span></span><span style><span style=3D"color:#660">&lt;&lt;</span><=
/span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></sp=
an><span style=3D"color:#800000"><span style=3D"color:#000">ptr</span></spa=
n><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><=
span style><span style=3D"color:#660">&lt;&lt;</span></span><span style=3D"=
color:#c0c0c0"><span style=3D"color:#000"> </span></span><span style=3D"col=
or:#800080"><span style=3D"color:#000">std</span></span><span style><span s=
tyle=3D"color:#660">::</span></span><span style>endl</span><span style><spa=
n style=3D"color:#660">;</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0 =C2=A0 =C2=A0</span></span><span style=3D"color:#808000"><span style=3D=
"color:#008">delete</span></span><span style=3D"color:#c0c0c0"><span style=
=3D"color:#000"> </span></span><span style=3D"color:#800000"><span style=3D=
"color:#000">ptr</span></span><span style><span style=3D"color:#660">;</spa=
n></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0</span></span><span style><span style=3D"color:#660">}</span></span></pr=
e><pre><span style=3D"font-family:Arial,Helvetica,sans-serif;color:rgb(192,=
192,192)"><span style=3D"color:#000"><br>
=C2=A0 =C2=A0 </span></span><span style=3D"font-family:Arial,Helvetica,sans=
-serif;color:rgb(128,0,128)"><span style=3D"color:#606">Foo</span></span><s=
pan style=3D"font-family:Arial,Helvetica,sans-serif"><span style=3D"color:#=
660">&amp;</span></span><span style=3D"font-family:Arial,Helvetica,sans-ser=
if;color:rgb(192,192,192)"><span style=3D"color:#000"> </span></span><span =
style=3D"font-family:Arial,Helvetica,sans-serif"><span style=3D"color:#008"=
>operator</span></span><span style=3D"font-family:Arial,Helvetica,sans-seri=
f"><span style=3D"color:#660">=3D(</span></span><span style=3D"font-family:=
Arial,Helvetica,sans-serif;color:rgb(128,0,128)"><span style=3D"color:#606"=
>Foo</span></span><span style=3D"font-family:Arial,Helvetica,sans-serif;col=
or:rgb(192,192,192)"><span style=3D"color:#000"> </span></span><span style=
=3D"font-family:Arial,Helvetica,sans-serif"><span style>other</span></span>=
<span style=3D"font-family:Arial,Helvetica,sans-serif"><span style=3D"color=
:#660">)</span></span><span style><br>
</span></pre><pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000">=
=C2=A0 =C2=A0 </span></span><span style><span style=3D"color:#660">{</span>=
</span></pre><pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000">=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0</span></span><span style=3D"color:#800080"><sp=
an style=3D"color:#000">std</span></span><span style><span style=3D"color:#=
660">::</span></span><span style>cout</span><span style=3D"color:#c0c0c0"><=
span style=3D"color:#000"> </span></span><span style><span style=3D"color:#=
660">&lt;&lt;</span></span><span style=3D"color:#c0c0c0"><span style=3D"col=
or:#000"> </span></span><span style=3D"color:#800000"><span style=3D"color:=
#000">ptr</span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#=
000"> </span></span><span style><span style=3D"color:#660">&lt;&lt;</span><=
/span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></sp=
an><span style=3D"color:#008000"><span style=3D"color:#080">&quot;=3D&quot;=
</span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </s=
pan></span><span style><span style=3D"color:#660">&lt;&lt;</span></span><sp=
an style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><span =
style><span style>other</span></span><span style><span style=3D"color:#660"=
>.</span></span><span style=3D"color:#800000"><span style=3D"color:#000">pt=
r</span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </=
span></span><span style><span style=3D"color:#660">&lt;&lt;</span></span><s=
pan style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><span=
 style=3D"color:#800080"><span style=3D"color:#000">std</span></span><span =
style><span style=3D"color:#660">::</span></span><span style>endl</span><sp=
an style><span style=3D"color:#660">;</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0 =C2=A0 =C2=A0</span></span><span style=3D"color:#808000"><span style=3D=
"color:#008">return</span></span><span style=3D"color:#c0c0c0"><span style=
=3D"color:#000"> </span></span><span style><span style>swap</span></span><s=
pan style><span style=3D"color:#660">(</span></span><span style><span style=
>other</span></span><span style><span style=3D"color:#660">);</span></span>=
</pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0</span></span><span style><span style=3D"color:#660">}</span></span></pr=
e><pre><span style><br></span></pre><pre><span style=3D"color:#c0c0c0"><spa=
n style=3D"color:#000">=C2=A0 =C2=A0 </span></span><span style=3D"color:#80=
8000"><span style=3D"color:#008">operator</span></span><span style=3D"color=
:#c0c0c0"><span style=3D"color:#000"> </span></span><span style=3D"color:#8=
08000"><span style=3D"color:#008">int</span></span><span style><span style=
=3D"color:#660">()</span></span><span style=3D"color:#c0c0c0"><span style=
=3D"color:#000"> </span></span><span style=3D"color:#808000"><span style=3D=
"color:#008">const</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0</span></span><span style><span style=3D"color:#660">{</span></span></pr=
e><pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0 =C2=A0 =C2=A0</span></span><span style=3D"color:#808000"><span style=3D=
"color:#008">return</span></span><span style=3D"color:#c0c0c0"><span style=
=3D"color:#000"> </span></span><span style><span style=3D"color:#660">*</sp=
an></span><span style=3D"color:#800000"><span style=3D"color:#000">ptr</spa=
n></span><span style><span style=3D"color:#660">;</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0</span></span><span style><span style=3D"color:#660">}</span></span></pr=
e><span style><br></span><pre><span style=3D"font-family:Arial,Helvetica,sa=
ns-serif;color:rgb(192,192,192)"><span style=3D"color:#000">=C2=A0 =C2=A0 <=
/span></span><span style=3D"font-family:Arial,Helvetica,sans-serif;color:rg=
b(128,0,128)"><span style=3D"color:#606">Foo</span></span><span style=3D"fo=
nt-family:Arial,Helvetica,sans-serif"><span style=3D"color:#660">&amp;</spa=
n></span><span style=3D"font-family:Arial,Helvetica,sans-serif;color:rgb(19=
2,192,192)"><span style=3D"color:#000"> </span></span><span style=3D"font-f=
amily:Arial,Helvetica,sans-serif"><span style>swap</span></span><span style=
=3D"font-family:Arial,Helvetica,sans-serif"><span style=3D"color:#660">(</s=
pan></span><span style=3D"font-family:Arial,Helvetica,sans-serif;color:rgb(=
128,0,128)"><span style=3D"color:#606">Foo</span></span><span style=3D"font=
-family:Arial,Helvetica,sans-serif"><span style=3D"color:#660">&amp;</span>=
</span><span style=3D"font-family:Arial,Helvetica,sans-serif;color:rgb(192,=
192,192)"><span style=3D"color:#000"> </span></span><span style=3D"font-fam=
ily:Arial,Helvetica,sans-serif"><span style>other</span></span><span style=
=3D"font-family:Arial,Helvetica,sans-serif"><span style=3D"color:#660">)</s=
pan></span><span style><br>
</span></pre><pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000">=
=C2=A0 =C2=A0 </span></span><span style><span style=3D"color:#660">{</span>=
</span></pre><pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000">=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0</span></span><span style=3D"color:#800080"><sp=
an style=3D"color:#000">std</span></span><span style><span style=3D"color:#=
660">::</span></span><span style>cout</span><span style=3D"color:#c0c0c0"><=
span style=3D"color:#000"> </span></span><span style><span style=3D"color:#=
660">&lt;&lt;</span></span><span style=3D"color:#c0c0c0"><span style=3D"col=
or:#000"> </span></span><span style=3D"color:#800000"><span style=3D"color:=
#000">ptr</span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#=
000"> </span></span><span style><span style=3D"color:#660">&lt;&lt;</span><=
/span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></sp=
an><span style=3D"color:#008000"><span style=3D"color:#080">&quot;~&quot;</=
span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </spa=
n></span><span style><span style=3D"color:#660">&lt;&lt;</span></span><span=
 style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><span st=
yle><span style>other</span></span><span style><span style=3D"color:#660">.=
</span></span><span style=3D"color:#800000"><span style=3D"color:#000">ptr<=
/span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </sp=
an></span><span style><span style=3D"color:#660">&lt;&lt;</span></span><spa=
n style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><span s=
tyle=3D"color:#800080"><span style=3D"color:#000">std</span></span><span st=
yle><span style=3D"color:#660">::</span></span><span style>endl</span><span=
 style><span style=3D"color:#660">;</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0 =C2=A0 =C2=A0</span></span><span style=3D"color:#800080"><span style=3D=
"color:#000">std</span></span><span style><span style=3D"color:#660">::</sp=
an></span><span style><span style>swap</span></span><span style><span style=
=3D"color:#660">(</span></span><span style=3D"color:#800000"><span style=3D=
"color:#000">ptr</span></span><span style><span style=3D"color:#660">,</spa=
n></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span><=
/span><span style><span style>other</span></span><span style><span style=3D=
"color:#660">.</span></span><span style=3D"color:#800000"><span style=3D"co=
lor:#000">ptr</span></span><span style><span style=3D"color:#660">);</span>=
</span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0</span></span><span style><span style=3D"color:#660">}</span></span></pr=
e><pre><span style=3D"font-family:Arial,Helvetica,sans-serif;color:rgb(128,=
128,0)"><span style=3D"color:#008">private</span></span><span style=3D"font=
-family:Arial,Helvetica,sans-serif"><span style=3D"color:#660">:</span></sp=
an><span style><br>
</span></pre><pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000">=
=C2=A0 =C2=A0 </span></span><span style=3D"color:#808000"><span style=3D"co=
lor:#008">int</span></span><span style=3D"color:#c0c0c0"><span style=3D"col=
or:#000"> </span></span><span style><span style=3D"color:#660">*</span></sp=
an><span style=3D"color:#800000"><span style=3D"color:#000">ptr</span></spa=
n><span style><span style=3D"color:#660">;</span></span></pre>
<pre><span style><span style=3D"color:#660">};</span></span></pre><pre><spa=
n style><br></span></pre><pre><span style=3D"color:#c0c0c0"><span style=3D"=
color:#000">=C2=A0 =C2=A0 </span></span><span style=3D"color:#808000"><span=
 style=3D"color:#008">int</span></span><span style=3D"color:#c0c0c0"><span =
style=3D"color:#000"> </span></span><span style><span style>main</span></sp=
an><span style><span style=3D"color:#660">()</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0</span></span><span style><span style=3D"color:#660">{</span></span></pr=
e><pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0 =C2=A0 =C2=A0</span></span><span style=3D"color:#800080"><span style=3D=
"color:#606">Foo</span></span><span style=3D"color:#c0c0c0"><span style=3D"=
color:#000"> </span></span><span style><span style>a</span></span><span sty=
le><span style=3D"color:#660">(</span></span><span style=3D"color:#000080">=
<span style=3D"color:#066">1</span></span><span style><span style=3D"color:=
#660">);</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0 =C2=A0 =C2=A0</span></span><span style=3D"color:#800080"><span style=3D=
"color:#606">Foo</span></span><span style=3D"color:#c0c0c0"><span style=3D"=
color:#000"> </span></span><span style><span style>b</span></span><span sty=
le><span style=3D"color:#660">(</span></span><span style=3D"color:#800080">=
<span style=3D"color:#000">std</span></span><span style><span style=3D"colo=
r:#660">::</span></span><span style>move</span><span style><span style=3D"c=
olor:#660">(</span></span><span style><span style>a</span></span><span styl=
e><span style=3D"color:#660">));</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0 =C2=A0 =C2=A0</span></span><span style=3D"color:#800080"><span style=3D=
"color:#000">std</span></span><span style><span style=3D"color:#660">::</sp=
an></span><span style>cout</span><span style=3D"color:#c0c0c0"><span style=
=3D"color:#000"> </span></span><span style><span style=3D"color:#660">&lt;&=
lt;</span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =
</span></span><span style><span style>a</span></span><span style=3D"color:#=
c0c0c0"><span style=3D"color:#000"> </span></span><span style><span style=
=3D"color:#660">&lt;&lt;</span></span><span style=3D"color:#c0c0c0"><span s=
tyle=3D"color:#000"> </span></span><span style=3D"color:#008000"><span styl=
e=3D"color:#080">&quot;</span></span><span style=3D"color:#c0c0c0"><span st=
yle=3D"color:#080"> </span></span><span style=3D"color:#008000"><span style=
=3D"color:#080">&quot;</span></span><span style=3D"color:#c0c0c0"><span sty=
le=3D"color:#000"> </span></span><span style><span style=3D"color:#660">&lt=
;&lt;</span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"=
> </span></span><span style><span style>b</span></span><span style=3D"color=
:#c0c0c0"><span style=3D"color:#000"> </span></span><span style><span style=
=3D"color:#660">&lt;&lt;</span></span><span style=3D"color:#c0c0c0"><span s=
tyle=3D"color:#000"> </span></span><span style=3D"color:#800080"><span styl=
e=3D"color:#000">std</span></span><span style><span style=3D"color:#660">::=
</span></span><span style>endl</span><span style><span style=3D"color:#660"=
>;</span></span></pre>
<span style><br></span><pre><span style=3D"color:#c0c0c0"><span style=3D"co=
lor:#000">=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span></span><span style=3D"color:#8=
00080"><span style=3D"color:#606">Foo</span></span><span style=3D"color:#c0=
c0c0"><span style=3D"color:#000"> </span></span><span style><span style>c</=
span></span><span style><span style=3D"color:#660">(</span></span><span sty=
le=3D"color:#000080"><span style=3D"color:#066">2</span></span><span style>=
<span style=3D"color:#660">);</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0 =C2=A0 =C2=A0</span></span><span style><span style>c</span></span><span=
 style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><span st=
yle><span style=3D"color:#660">=3D</span></span><span style=3D"color:#c0c0c=
0"><span style=3D"color:#000"> </span></span><span style=3D"color:#800080">=
<span style=3D"color:#000">std</span></span><span style><span style=3D"colo=
r:#660">::</span></span><span style>move</span><span style><span style=3D"c=
olor:#660">(</span></span><span style><span style>b</span></span><span styl=
e><span style=3D"color:#660">);</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0 =C2=A0 =C2=A0</span></span><span style=3D"color:#800080"><span style=3D=
"color:#000">std</span></span><span style><span style=3D"color:#660">::</sp=
an></span><span style>cout</span><span style=3D"color:#c0c0c0"><span style=
=3D"color:#000"> </span></span><span style><span style=3D"color:#660">&lt;&=
lt;</span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =
</span></span><span style><span style>c</span></span><span style=3D"color:#=
c0c0c0"><span style=3D"color:#000"> </span></span><span style><span style=
=3D"color:#660">&lt;&lt;</span></span><span style=3D"color:#c0c0c0"><span s=
tyle=3D"color:#000"> </span></span><span style=3D"color:#008000"><span styl=
e=3D"color:#080">&quot;</span></span><span style=3D"color:#c0c0c0"><span st=
yle=3D"color:#080"> </span></span><span style=3D"color:#008000"><span style=
=3D"color:#080">&quot;</span></span><span style=3D"color:#c0c0c0"><span sty=
le=3D"color:#000"> </span></span><span style><span style=3D"color:#660">&lt=
;&lt;</span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"=
> </span></span><span style><span style>b</span></span><span style=3D"color=
:#c0c0c0"><span style=3D"color:#000"> </span></span><span style><span style=
=3D"color:#660">&lt;&lt;</span></span><span style=3D"color:#c0c0c0"><span s=
tyle=3D"color:#000"> </span></span><span style=3D"color:#800080"><span styl=
e=3D"color:#000">std</span></span><span style><span style=3D"color:#660">::=
</span></span><span style>endl</span><span style><span style=3D"color:#660"=
>;</span></span></pre>
<span style><br></span><pre><span style=3D"color:#c0c0c0"><span style=3D"co=
lor:#000">=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span></span><span style=3D"color:#8=
00080"><span style=3D"color:#606">Foo</span></span><span style=3D"color:#c0=
c0c0"><span style=3D"color:#000"> </span></span><span style><span style>d</=
span></span><span style><span style=3D"color:#660">(</span></span><span sty=
le=3D"color:#000080"><span style=3D"color:#066">3</span></span><span style>=
<span style=3D"color:#660">);</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0 =C2=A0 =C2=A0</span></span><span style><span style>d</span></span><span=
 style=3D"color:#c0c0c0"><span style=3D"color:#000"> </span></span><span st=
yle><span style=3D"color:#660">=3D</span></span><span style=3D"color:#c0c0c=
0"><span style=3D"color:#000"> </span></span><span style><span style>b</spa=
n></span><span style><span style=3D"color:#660">;</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0 =C2=A0 =C2=A0</span></span><span style=3D"color:#800080"><span style=3D=
"color:#000">std</span></span><span style><span style=3D"color:#660">::</sp=
an></span><span style>cout</span><span style=3D"color:#c0c0c0"><span style=
=3D"color:#000"> </span></span><span style><span style=3D"color:#660">&lt;&=
lt;</span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =
</span></span><span style><span style>d</span></span><span style=3D"color:#=
c0c0c0"><span style=3D"color:#000"> </span></span><span style><span style=
=3D"color:#660">&lt;&lt;</span></span><span style=3D"color:#c0c0c0"><span s=
tyle=3D"color:#000"> </span></span><span style=3D"color:#008000"><span styl=
e=3D"color:#080">&quot;</span></span><span style=3D"color:#c0c0c0"><span st=
yle=3D"color:#080"> </span></span><span style=3D"color:#008000"><span style=
=3D"color:#080">&quot;</span></span><span style=3D"color:#c0c0c0"><span sty=
le=3D"color:#000"> </span></span><span style><span style=3D"color:#660">&lt=
;&lt;</span></span><span style=3D"color:#c0c0c0"><span style=3D"color:#000"=
> </span></span><span style><span style>b</span></span><span style=3D"color=
:#c0c0c0"><span style=3D"color:#000"> </span></span><span style><span style=
=3D"color:#660">&lt;&lt;</span></span><span style=3D"color:#c0c0c0"><span s=
tyle=3D"color:#000"> </span></span><span style=3D"color:#800080"><span styl=
e=3D"color:#000">std</span></span><span style><span style=3D"color:#660">::=
</span></span><span style>endl</span><span style><span style=3D"color:#660"=
>;</span></span></pre>
<pre><span style=3D"color:#c0c0c0"><span style=3D"color:#000"> =C2=A0 =C2=
=A0</span></span><span style><span style=3D"color:#660">}</span></span></pr=
e></div></code></div><div style=3D"background-color:rgb(250,250,250);border=
:1px solid rgb(187,187,187);word-wrap:break-word">
<code><div><div><font color=3D"#660066">0x25216d0(1)</font></div><div><font=
 color=3D"#660066">0x2521720(&amp;&amp;0x25216d0)</font></div><div><font co=
lor=3D"#660066">0x2521720~0x25216d0</font></div><div><font color=3D"#660066=
">0 1</font></div>
<div><font color=3D"#660066">0x2523b60(2)</font></div><div><font color=3D"#=
660066">0x2567d20(&amp;&amp;0x25216d0)</font></div><div><font color=3D"#660=
066">0x2567d20~0x25216d0</font></div><div><font color=3D"#660066">0x2523b60=
=3D0x25216d0</font></div>
<div><font color=3D"#660066">0x2523b60~0x25216d0</font></div><div><font col=
or=3D"#660066">~0x2523b60</font></div><div><font color=3D"#660066">1 0</fon=
t></div><div><font color=3D"#660066">0x2523b60(3)</font></div><div><font co=
lor=3D"#660066">0x2568c20(&amp;0x2567d20)</font></div>
<div><font color=3D"#660066">0x2523b60=3D0x2568c20</font></div><div><font c=
olor=3D"#660066">0x2523b60~0x2568c20</font></div><div><font color=3D"#66006=
6">~0x2523b60</font></div><div><font color=3D"#660066">0 0</font></div><div=
><font color=3D"#660066">~0x2568c20</font></div>
<div><font color=3D"#660066">~0x25216d0</font></div><div><font color=3D"#66=
0066">~0x2567d20</font></div><div><font color=3D"#660066">~0x2521720</font>=
</div><div><br></div></div></code></div><br>As you can see here there is a =
lot of code that can be copy and pasted to other classes basically.<br>
Why do all this manually, unless in a special case that can be overloaded?=
=C2=A0I feel like this should be default behavior, like the copy constructo=
r is.<div><br>In the current situation we have no guarantee that a class is=
 swap-able or move-able. (Copies instead of swaps)<br>
This guarantee however can make containers a lot more efficient as well =C2=
=A0when dealing with large amounts of data that can basically be swapped.<b=
r>I propose the syntax a~b for, ::operator~(one, two) which is different fr=
om ::operator~(one). The ~ symbol kinda looks like a swapping symbol to me.=
<div>
<br>This code should be the default behavior for all classes, internal type=
s such as int or pointers are all swap-able like classes with the ~ operato=
r.<br>It does the same thing as the default copy constructor except copying=
 it does swapping.<br>
<div style=3D"background-color:rgb(250,250,250);border:1px solid rgb(187,18=
7,187);word-wrap:break-word"><code><div><pre><span style=3D"font-family:Ari=
al,Helvetica,sans-serif;color:rgb(192,192,192)">=C2=A0 =C2=A0 </span><span =
style=3D"font-family:Arial,Helvetica,sans-serif;color:rgb(128,0,128)">Foo</=
span><span style=3D"font-family:Arial,Helvetica,sans-serif">&amp;</span><sp=
an style=3D"font-family:Arial,Helvetica,sans-serif;color:rgb(192,192,192)">=
 </span><span style=3D"font-family:Arial,Helvetica,sans-serif">operator~</s=
pan><span style=3D"font-family:Arial,Helvetica,sans-serif">(</span><span st=
yle=3D"font-family:Arial,Helvetica,sans-serif;color:rgb(128,0,128)">Foo</sp=
an><span style=3D"font-family:Arial,Helvetica,sans-serif">&amp;</span><span=
 style=3D"font-family:Arial,Helvetica,sans-serif;color:rgb(192,192,192)"> <=
/span><span style=3D"font-family:Arial,Helvetica,sans-serif">other</span><s=
pan style=3D"font-family:Arial,Helvetica,sans-serif">)</span><br>
</pre><pre><span style=3D"color:rgb(192,192,192)">=C2=A0 =C2=A0 </span><spa=
n style>{<br>        x ~ other.x; //int<br>        y ~ other.y; </span><spa=
n style=3D"color:rgb(102,102,0);font-family:Arial,Helvetica,sans-serif">//i=
nt</span><span style><br>
</span><span style>        z ~ other.z; </span><span style=3D"color:rgb(102=
,102,0);font-family:Arial,Helvetica,sans-serif">//int</span></pre><pre><spa=
n style=3D"color:rgb(192,192,192)"> =C2=A0 =C2=A0 =C2=A0 =C2=A0</span><span=
 style=3D"color:rgb(128,0,0)">ptr ~ </span><span style>other</span><font co=
lor=3D"#666600">.</font><span style=3D"color:rgb(128,0,0)">ptr</span><span =
style>; // ptr to int<br>
        bar ~ other.bar; // class Bar</span></pre><pre><span style=3D"color=
:rgb(192,192,192)"> =C2=A0 =C2=A0</span><span style>}</span></pre></div></c=
ode></div><br>The default copy constructor does not respect initialization,=
 it might work for PODS but not for classes that take care of pointers or o=
ther data.<br>
<div><div style=3D"background-color:rgb(250,250,250);border:1px solid rgb(1=
87,187,187);word-wrap:break-word"><code><div><p style=3D"margin-bottom:0px"=
><span style=3D"font-family:Arial,Helvetica,sans-serif;color:rgb(192,192,19=
2)">=C2=A0 =C2=A0 </span><span style=3D"font-family:Arial,Helvetica,sans-se=
rif;color:rgb(128,0,128)">Foo</span><span style=3D"font-family:Arial,Helvet=
ica,sans-serif">&amp;</span><span style=3D"font-family:Arial,Helvetica,sans=
-serif;color:rgb(192,192,192)"> </span><span style=3D"font-family:Arial,Hel=
vetica,sans-serif;color:rgb(128,128,0)">operator</span><span style=3D"font-=
family:Arial,Helvetica,sans-serif">=3D(</span><span style=3D"font-family:Ar=
ial,Helvetica,sans-serif;color:rgb(128,128,0)">const</span><span style=3D"f=
ont-family:Arial,Helvetica,sans-serif;color:rgb(192,192,192)"> </span><span=
 style=3D"font-family:Arial,Helvetica,sans-serif;color:rgb(128,0,128)">Foo<=
/span><span style=3D"font-family:Arial,Helvetica,sans-serif">&amp;</span><s=
pan style=3D"font-family:Arial,Helvetica,sans-serif;color:rgb(192,192,192)"=
> </span><span style=3D"font-family:Arial,Helvetica,sans-serif">other</span=
><span style=3D"font-family:Arial,Helvetica,sans-serif">)</span></p>
<pre><span style=3D"color:#c0c0c0"> =C2=A0 =C2=A0</span><span style>{</span=
></pre><pre><span style=3D"color:#c0c0c0"> =C2=A0 =C2=A0 =C2=A0 =C2=A0</spa=
n>x<span style=3D"color:#c0c0c0"> </span><span style>=3D</span><span style=
=3D"color:#c0c0c0"> </span><span style>other</span><span style>.</span>x<sp=
an style>;</span></pre>
<pre><span style=3D"color:#c0c0c0"> =C2=A0 =C2=A0 =C2=A0 =C2=A0</span>y<spa=
n style=3D"color:#c0c0c0"> </span><span style>=3D</span><span style=3D"colo=
r:#c0c0c0"> </span><span style>other</span><span style>.</span>y<span style=
>;</span></pre><pre><span style=3D"color:#c0c0c0"> =C2=A0 =C2=A0 =C2=A0 =C2=
=A0</span>z<span style=3D"color:#c0c0c0"> </span><span style>=3D</span><spa=
n style=3D"color:#c0c0c0"> </span><span style>other</span><span style>.</sp=
an>z<span style>;</span></pre>
<pre><span style=3D"color:#c0c0c0"> =C2=A0 =C2=A0 =C2=A0 =C2=A0</span><span=
 style=3D"color:#800000">ptr</span><span style=3D"color:#c0c0c0"> </span><s=
pan style>=3D</span><span style=3D"color:#c0c0c0"> </span><span style>other=
</span><span style>.</span><span style=3D"color:#800000">ptr</span><span st=
yle>;<br>
        bar =3D other.bar;</span></pre><pre><span style=3D"color:#c0c0c0"> =
=C2=A0 =C2=A0 =C2=A0 =C2=A0</span><span style=3D"color:#808000">return</spa=
n><span style=3D"color:#c0c0c0"> </span><span style>*</span><span style=3D"=
color:#808000">this</span><span style>;</span></pre>
<pre><span style=3D"color:#c0c0c0"> =C2=A0 =C2=A0</span><span style>}</span=
></pre><pre><span style=3D"color:#c0c0c0"> =C2=A0 =C2=A0</span></pre></div>=
</code></div><br>If we had an internal swap-ing mechanism the default behav=
ior can easily be replaced with this code.<br>
The copy constructor will work both for PODS and classes that manage points=
 or other data and respect data initialization.<br><div style=3D"background=
-color:rgb(250,250,250);border:1px solid rgb(187,187,187);word-wrap:break-w=
ord">
<code><div><pre><span style=3D"color:#c0c0c0">=C2=A0 =C2=A0 </span><span st=
yle=3D"color:#800080">Foo</span><span style>&amp;</span><span style=3D"colo=
r:#c0c0c0"> </span><span style>operator</span><span style>=3D(</span><span =
style=3D"color:#800080">Foo</span><span style=3D"color:#c0c0c0"> </span><sp=
an style>other</span><span style>)</span></pre>
<pre><span style=3D"color:#c0c0c0"> =C2=A0 =C2=A0</span><span style>{</span=
></pre><pre><span style=3D"color:#c0c0c0"> =C2=A0 =C2=A0 =C2=A0 =C2=A0</spa=
n><span style=3D"color:#808000">return</span><span style=3D"color:#c0c0c0">=
 *this ~ other</span><span style>;</span></pre>
<pre><span style=3D"color:#c0c0c0"> =C2=A0 =C2=A0</span><span style>}</span=
></pre></div></code></div>or=C2=A0<br><div style=3D"background-color:rgb(25=
0,250,250);border:1px solid rgb(187,187,187);word-wrap:break-word"><code><d=
iv><pre><span style=3D"color:rgb(192,192,192)">=C2=A0 =C2=A0 </span><span s=
tyle=3D"color:rgb(128,0,128)">Foo</span><span style>&amp;</span><span style=
=3D"color:rgb(192,192,192)"> </span><span style>operator</span><span style>=
=3D(const </span><span style=3D"color:rgb(128,0,128)">Foo&amp;</span><span =
style=3D"color:rgb(192,192,192)"> </span><span style>other</span><span styl=
e>)</span></pre>
<pre><span style=3D"color:rgb(192,192,192)"> =C2=A0 =C2=A0</span><span styl=
e>{</span></pre><pre><span style=3D"color:rgb(192,192,192)"> =C2=A0 =C2=A0 =
=C2=A0 =C2=A0</span><span style=3D"color:rgb(128,128,0)">return</span><span=
 style=3D"color:rgb(192,192,192)"> *this ~ Foo(other)</span><span style>;</=
span></pre>
<pre><span style=3D"color:rgb(192,192,192)"> =C2=A0 =C2=A0</span><span styl=
e>}<br><br></span><pre><span style=3D"color:rgb(192,192,192)">=C2=A0 =C2=A0=
 </span><span style=3D"color:rgb(128,0,128)">Foo</span><span style>&amp;</s=
pan><span style=3D"color:rgb(192,192,192)"> </span><span style>operator</sp=
an><span style>=3D(</span><span style=3D"color:rgb(128,0,128)">Foo&amp;&amp=
;</span><span style=3D"color:rgb(192,192,192)"> </span><span style>other</s=
pan><span style>)</span></pre>
<pre><span style=3D"color:rgb(192,192,192)"> =C2=A0 =C2=A0</span><span styl=
e>{</span></pre><pre><span style=3D"color:rgb(192,192,192)"> =C2=A0 =C2=A0 =
=C2=A0 =C2=A0</span><span style=3D"color:rgb(128,128,0)">return</span><span=
 style=3D"color:rgb(192,192,192)"> *this ~ other</span><span style>;</span>=
</pre>
<pre><span style=3D"color:rgb(192,192,192)"> =C2=A0 =C2=A0</span><span styl=
e>}</span></pre></pre></div></code></div><br>The move constructor can have =
default behavior as well.<br><div style=3D"background-color:rgb(250,250,250=
);border:1px solid rgb(187,187,187);word-wrap:break-word">
<code><div><pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color=
:rgb(0,0,0)">=C2=A0 =C2=A0 </span></span><span style=3D"color:rgb(128,0,128=
)"><span style=3D"color:rgb(102,0,102)">Foo</span></span><span style><span =
style=3D"color:rgb(102,102,0)">(</span></span><span style=3D"color:rgb(128,=
0,128)"><span style=3D"color:rgb(102,0,102)">Foo</span></span><span style><=
span style=3D"color:rgb(102,102,0)">&amp;&amp;</span></span><span style=3D"=
color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> </span></span><sp=
an style>other</span><span style><span style=3D"color:rgb(102,102,0)">)</sp=
an></span></pre>
<pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)=
"> =C2=A0 =C2=A0</span></span><span style><span style=3D"color:rgb(102,102,=
0)">{<br>        Foo::Foo(); // default constructor</span></span></pre><pre=
><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> =
=C2=A0 =C2=A0 =C2=A0 =C2=A0*this ~ other;</span></span></pre>
<pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)=
"> =C2=A0 =C2=A0</span></span><span style><span style=3D"color:rgb(102,102,=
0)">}</span></span></pre><div><span style><span style=3D"color:rgb(102,102,=
0)"><br></span></span></div>
</div></code></div><br>Finally if we assume this implemented the original c=
lass would look like this and still function the same, in a pointer safe ma=
nner.<br>Also containers can swap the object around efficiently and neither=
 the user code or the STL implementation has to worry about the safety of t=
he pointer or the copying large amounts of data due to the lack of a move c=
onstructor or move operator.<br>
<div style=3D"background-color:rgb(250,250,250);border:1px solid rgb(187,18=
7,187);word-wrap:break-word"><code><div><p style=3D"margin-bottom:0px"><spa=
n style=3D"font-family:Arial,Helvetica,sans-serif;color:rgb(128,128,0)"><sp=
an style=3D"color:rgb(0,0,136)">class</span></span><span style=3D"font-fami=
ly:Arial,Helvetica,sans-serif;color:rgb(192,192,192)"><span style=3D"color:=
rgb(0,0,0)">=C2=A0</span></span><span style=3D"font-family:Arial,Helvetica,=
sans-serif;color:rgb(128,0,128)"><span style=3D"color:rgb(102,0,102)">Foo</=
span></span><span style><br>
</span></p><pre><span style><span style=3D"color:rgb(102,102,0)">{</span></=
span></pre><pre><span style=3D"color:rgb(128,128,0)"><span style=3D"color:r=
gb(0,0,136)">public</span></span><span style><span style=3D"color:rgb(102,1=
02,0)">:</span></span></pre>
<pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)=
"> =C2=A0 =C2=A0</span></span><span style=3D"color:rgb(128,0,128)"><span st=
yle=3D"color:rgb(102,0,102)">Foo</span></span><span style><span style=3D"co=
lor:rgb(102,102,0)">()</span></span></pre>
<pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)=
"> =C2=A0 =C2=A0 =C2=A0 =C2=A0</span></span><span style><span style=3D"colo=
r:rgb(102,102,0)">:</span></span><span style=3D"color:rgb(128,0,0)"><span s=
tyle=3D"color:rgb(0,0,0)">ptr</span></span><span style><span style=3D"color=
:rgb(102,102,0)">(</span></span><span style=3D"color:rgb(128,128,0)"><span =
style=3D"color:rgb(0,0,136)">new</span></span><span style=3D"color:rgb(192,=
192,192)"><span style=3D"color:rgb(0,0,0)"> </span></span><span style=3D"co=
lor:rgb(128,128,0)"><span style=3D"color:rgb(0,0,136)">int</span></span><sp=
an style><span style=3D"color:rgb(102,102,0)">(</span></span><span style=3D=
"color:rgb(0,0,128)"><span style=3D"color:rgb(0,102,102)">0</span></span><s=
pan style><span style=3D"color:rgb(102,102,0)">))</span></span></pre>
<pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)=
"> =C2=A0 =C2=A0</span></span><span style><span style=3D"color:rgb(102,102,=
0)">{</span></span></pre><pre><span style=3D"color:rgb(192,192,192)"><span =
style=3D"color:rgb(0,0,0)"> =C2=A0 =C2=A0 =C2=A0 =C2=A0</span></span><span =
style=3D"color:rgb(128,0,128)"><span style=3D"color:rgb(0,0,0)">std</span><=
/span><span style><span style=3D"color:rgb(102,102,0)">::</span></span><spa=
n style>cout</span><span style=3D"color:rgb(192,192,192)"><span style=3D"co=
lor:rgb(0,0,0)"> </span></span><span style><span style=3D"color:rgb(102,102=
,0)">&lt;&lt;</span></span><span style=3D"color:rgb(192,192,192)"><span sty=
le=3D"color:rgb(0,0,0)"> </span></span><span style=3D"color:rgb(128,0,0)"><=
span style=3D"color:rgb(0,0,0)">ptr</span></span><span style=3D"color:rgb(1=
92,192,192)"><span style=3D"color:rgb(0,0,0)"> </span></span><span style><s=
pan style=3D"color:rgb(102,102,0)">&lt;&lt;</span></span><span style=3D"col=
or:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> </span></span><span =
style=3D"color:rgb(0,128,0)"><span style=3D"color:rgb(0,136,0)">&quot;()&qu=
ot;</span></span><span style=3D"color:rgb(192,192,192)"><span style=3D"colo=
r:rgb(0,0,0)"> </span></span><span style><span style=3D"color:rgb(102,102,0=
)">&lt;&lt;</span></span><span style=3D"color:rgb(192,192,192)"><span style=
=3D"color:rgb(0,0,0)"> </span></span><span style=3D"color:rgb(128,0,128)"><=
span style=3D"color:rgb(0,0,0)">std</span></span><span style><span style=3D=
"color:rgb(102,102,0)">::</span></span><span style>endl</span><span style><=
span style=3D"color:rgb(102,102,0)">;</span></span></pre>
<pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)=
"> =C2=A0 =C2=A0</span></span><span style><span style=3D"color:rgb(102,102,=
0)">}</span></span></pre><pre><span style><br></span></pre><pre><span style=
=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)">=C2=A0 =C2=A0 =
</span></span><span style=3D"color:rgb(128,0,128)"><span style=3D"color:rgb=
(102,0,102)">Foo</span></span><span style><span style=3D"color:rgb(102,102,=
0)">(</span></span><span style=3D"color:rgb(128,128,0)"><span style=3D"colo=
r:rgb(0,0,136)">int</span></span><span style=3D"color:rgb(192,192,192)"><sp=
an style=3D"color:rgb(0,0,0)"> </span></span><span style>val</span><span st=
yle><span style=3D"color:rgb(102,102,0)">)</span></span></pre>
<pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)=
"> =C2=A0 =C2=A0 =C2=A0 =C2=A0</span></span><span style><span style=3D"colo=
r:rgb(102,102,0)">:</span></span><span style=3D"color:rgb(128,0,0)"><span s=
tyle=3D"color:rgb(0,0,0)">ptr</span></span><span style><span style=3D"color=
:rgb(102,102,0)">(</span></span><span style=3D"color:rgb(128,128,0)"><span =
style=3D"color:rgb(0,0,136)">new</span></span><span style=3D"color:rgb(192,=
192,192)"><span style=3D"color:rgb(0,0,0)"> </span></span><span style=3D"co=
lor:rgb(128,128,0)"><span style=3D"color:rgb(0,0,136)">int</span></span><sp=
an style><span style=3D"color:rgb(102,102,0)">(</span></span><span style>va=
l</span><span style><span style=3D"color:rgb(102,102,0)">))</span></span></=
pre>
<pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)=
"> =C2=A0 =C2=A0</span></span><span style><span style=3D"color:rgb(102,102,=
0)">{</span></span></pre><pre><span style=3D"color:rgb(192,192,192)"><span =
style=3D"color:rgb(0,0,0)"> =C2=A0 =C2=A0 =C2=A0 =C2=A0</span></span><span =
style=3D"color:rgb(128,0,128)"><span style=3D"color:rgb(0,0,0)">std</span><=
/span><span style><span style=3D"color:rgb(102,102,0)">::</span></span><spa=
n style>cout</span><span style=3D"color:rgb(192,192,192)"><span style=3D"co=
lor:rgb(0,0,0)"> </span></span><span style><span style=3D"color:rgb(102,102=
,0)">&lt;&lt;</span></span><span style=3D"color:rgb(192,192,192)"><span sty=
le=3D"color:rgb(0,0,0)"> </span></span><span style=3D"color:rgb(128,0,0)"><=
span style=3D"color:rgb(0,0,0)">ptr</span></span><span style=3D"color:rgb(1=
92,192,192)"><span style=3D"color:rgb(0,0,0)"> </span></span><span style><s=
pan style=3D"color:rgb(102,102,0)">&lt;&lt;</span></span><span style=3D"col=
or:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> </span></span><span =
style=3D"color:rgb(0,128,0)"><span style=3D"color:rgb(0,136,0)">&quot;(&quo=
t;</span></span><span style=3D"color:rgb(192,192,192)"><span style=3D"color=
:rgb(0,0,0)"> </span></span><span style><span style=3D"color:rgb(102,102,0)=
">&lt;&lt;</span></span><span style=3D"color:rgb(192,192,192)"><span style=
=3D"color:rgb(0,0,0)"> </span></span><span style>val</span><span style=3D"c=
olor:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> </span></span><spa=
n style><span style=3D"color:rgb(102,102,0)">&lt;&lt;</span></span><span st=
yle=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> </span></s=
pan><span style=3D"color:rgb(0,128,0)"><span style=3D"color:rgb(0,136,0)">&=
quot;)&quot;</span></span><span style=3D"color:rgb(192,192,192)"><span styl=
e=3D"color:rgb(0,0,0)"> </span></span><span style><span style=3D"color:rgb(=
102,102,0)">&lt;&lt;</span></span><span style=3D"color:rgb(192,192,192)"><s=
pan style=3D"color:rgb(0,0,0)"> </span></span><span style=3D"color:rgb(128,=
0,128)"><span style=3D"color:rgb(0,0,0)">std</span></span><span style><span=
 style=3D"color:rgb(102,102,0)">::</span></span><span style>endl</span><spa=
n style><span style=3D"color:rgb(102,102,0)">;</span></span></pre>
<pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)=
"> =C2=A0 =C2=A0</span></span><span style><span style=3D"color:rgb(102,102,=
0)">}</span></span></pre><pre><span style><br></span></pre><pre><span style=
=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)">=C2=A0 =C2=A0 =
</span></span><span style=3D"color:rgb(128,0,128)"><span style=3D"color:rgb=
(102,0,102)">Foo</span></span><span style><span style=3D"color:rgb(102,102,=
0)">(</span></span><span style=3D"color:rgb(128,128,0)"><span style=3D"colo=
r:rgb(0,0,136)">const</span></span><span style=3D"color:rgb(192,192,192)"><=
span style=3D"color:rgb(0,0,0)"> </span></span><span style=3D"color:rgb(128=
,0,128)"><span style=3D"color:rgb(102,0,102)">Foo</span></span><span style>=
<span style=3D"color:rgb(102,102,0)">&amp;</span></span><span style=3D"colo=
r:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> </span></span><span s=
tyle>other</span><span style><span style=3D"color:rgb(102,102,0)">)</span><=
/span></pre>
<pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)=
"> =C2=A0 =C2=A0 =C2=A0 =C2=A0</span></span><span style><span style=3D"colo=
r:rgb(102,102,0)">:</span></span><span style=3D"color:rgb(128,0,0)"><span s=
tyle=3D"color:rgb(0,0,0)">ptr</span></span><span style><span style=3D"color=
:rgb(102,102,0)">(</span></span><span style=3D"color:rgb(128,128,0)"><span =
style=3D"color:rgb(0,0,136)">new</span></span><span style=3D"color:rgb(192,=
192,192)"><span style=3D"color:rgb(0,0,0)"> </span></span><span style=3D"co=
lor:rgb(128,128,0)"><span style=3D"color:rgb(0,0,136)">int</span></span><sp=
an style><span style=3D"color:rgb(102,102,0)">(</span></span><span style>ot=
her</span><span style><span style=3D"color:rgb(102,102,0)">))</span></span>=
</pre>
<pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)=
"> =C2=A0 =C2=A0</span></span><span style><span style=3D"color:rgb(102,102,=
0)">{</span></span></pre><pre><span style=3D"color:rgb(192,192,192)"><span =
style=3D"color:rgb(0,0,0)"> =C2=A0 =C2=A0 =C2=A0 =C2=A0</span></span><span =
style=3D"color:rgb(128,0,128)"><span style=3D"color:rgb(0,0,0)">std</span><=
/span><span style><span style=3D"color:rgb(102,102,0)">::</span></span><spa=
n style>cout</span><span style=3D"color:rgb(192,192,192)"><span style=3D"co=
lor:rgb(0,0,0)"> </span></span><span style><span style=3D"color:rgb(102,102=
,0)">&lt;&lt;</span></span><span style=3D"color:rgb(192,192,192)"><span sty=
le=3D"color:rgb(0,0,0)"> </span></span><span style=3D"color:rgb(128,0,0)"><=
span style=3D"color:rgb(0,0,0)">ptr</span></span><span style=3D"color:rgb(1=
92,192,192)"><span style=3D"color:rgb(0,0,0)"> </span></span><span style><s=
pan style=3D"color:rgb(102,102,0)">&lt;&lt;</span></span><span style=3D"col=
or:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> </span></span><span =
style=3D"color:rgb(0,128,0)"><span style=3D"color:rgb(0,136,0)">&quot;(&amp=
;&quot;</span></span><span style=3D"color:rgb(192,192,192)"><span style=3D"=
color:rgb(0,0,0)"> </span></span><span style><span style=3D"color:rgb(102,1=
02,0)">&lt;&lt;</span></span><span style=3D"color:rgb(192,192,192)"><span s=
tyle=3D"color:rgb(0,0,0)"> </span></span><span style>other</span><span styl=
e><span style=3D"color:rgb(102,102,0)">.</span></span><span style=3D"color:=
rgb(128,0,0)"><span style=3D"color:rgb(0,0,0)">ptr</span></span><span style=
=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> </span></span=
><span style><span style=3D"color:rgb(102,102,0)">&lt;&lt;</span></span><sp=
an style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> </spa=
n></span><span style=3D"color:rgb(0,128,0)"><span style=3D"color:rgb(0,136,=
0)">&quot;)&quot;</span></span><span style=3D"color:rgb(192,192,192)"><span=
 style=3D"color:rgb(0,0,0)"> </span></span><span style><span style=3D"color=
:rgb(102,102,0)">&lt;&lt;</span></span><span style=3D"color:rgb(192,192,192=
)"><span style=3D"color:rgb(0,0,0)"> </span></span><span style=3D"color:rgb=
(128,0,128)"><span style=3D"color:rgb(0,0,0)">std</span></span><span style>=
<span style=3D"color:rgb(102,102,0)">::</span></span><span style>endl</span=
><span style><span style=3D"color:rgb(102,102,0)">;</span></span></pre>
<pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)=
"> =C2=A0 =C2=A0</span></span><span style><span style=3D"color:rgb(102,102,=
0)">}</span></span></pre><pre><br></pre><pre><span style=3D"color:rgb(192,1=
92,192)"><span style=3D"color:rgb(0,0,0)">=C2=A0 =C2=A0 </span></span><span=
 style><span style=3D"color:rgb(102,102,0)">~</span></span><span style=3D"c=
olor:rgb(128,0,128)"><span style=3D"color:rgb(102,0,102)">Foo</span></span>=
<span style><span style=3D"color:rgb(102,102,0)">()</span></span></pre>
<pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)=
"> =C2=A0 =C2=A0</span></span><span style><span style=3D"color:rgb(102,102,=
0)">{</span></span></pre><pre><span style=3D"color:rgb(192,192,192)"><span =
style=3D"color:rgb(0,0,0)"> =C2=A0 =C2=A0 =C2=A0 =C2=A0</span></span><span =
style=3D"color:rgb(128,0,128)"><span style=3D"color:rgb(0,0,0)">std</span><=
/span><span style><span style=3D"color:rgb(102,102,0)">::</span></span><spa=
n style>cout</span><span style=3D"color:rgb(192,192,192)"><span style=3D"co=
lor:rgb(0,0,0)"> </span></span><span style><span style=3D"color:rgb(102,102=
,0)">&lt;&lt;</span></span><span style=3D"color:rgb(192,192,192)"><span sty=
le=3D"color:rgb(0,0,0)"> </span></span><span style=3D"color:rgb(0,128,0)"><=
span style=3D"color:rgb(0,136,0)">&quot;~&quot;</span></span><span style=3D=
"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> </span></span><s=
pan style><span style=3D"color:rgb(102,102,0)">&lt;&lt;</span></span><span =
style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> </span><=
/span><span style=3D"color:rgb(128,0,0)"><span style=3D"color:rgb(0,0,0)">p=
tr</span></span><span style=3D"color:rgb(192,192,192)"><span style=3D"color=
:rgb(0,0,0)"> </span></span><span style><span style=3D"color:rgb(102,102,0)=
">&lt;&lt;</span></span><span style=3D"color:rgb(192,192,192)"><span style=
=3D"color:rgb(0,0,0)"> </span></span><span style=3D"color:rgb(128,0,128)"><=
span style=3D"color:rgb(0,0,0)">std</span></span><span style><span style=3D=
"color:rgb(102,102,0)">::</span></span><span style>endl</span><span style><=
span style=3D"color:rgb(102,102,0)">;</span></span></pre>
<pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)=
"> =C2=A0 =C2=A0 =C2=A0 =C2=A0</span></span><span style=3D"color:rgb(128,12=
8,0)"><span style=3D"color:rgb(0,0,136)">delete</span></span><span style=3D=
"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> </span></span><s=
pan style=3D"color:rgb(128,0,0)"><span style=3D"color:rgb(0,0,0)">ptr</span=
></span><span style><span style=3D"color:rgb(102,102,0)">;</span></span></p=
re>
<pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)=
"> =C2=A0 =C2=A0</span></span><span style><span style=3D"color:rgb(102,102,=
0)">}</span></span></pre><pre><br></pre><pre><span style=3D"color:rgb(192,1=
92,192)"><span style=3D"color:rgb(0,0,0)">=C2=A0 =C2=A0 </span></span><span=
 style=3D"color:rgb(128,128,0)"><span style=3D"color:rgb(0,0,136)">operator=
</span></span><span style=3D"color:rgb(192,192,192)"><span style=3D"color:r=
gb(0,0,0)"> </span></span><span style=3D"color:rgb(128,128,0)"><span style=
=3D"color:rgb(0,0,136)">int</span></span><span style><span style=3D"color:r=
gb(102,102,0)">()</span></span><span style=3D"color:rgb(192,192,192)"><span=
 style=3D"color:rgb(0,0,0)"> </span></span><span style=3D"color:rgb(128,128=
,0)"><span style=3D"color:rgb(0,0,136)">const</span></span></pre>
<pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)=
"> =C2=A0 =C2=A0</span></span><span style><span style=3D"color:rgb(102,102,=
0)">{</span></span></pre><pre><span style=3D"color:rgb(192,192,192)"><span =
style=3D"color:rgb(0,0,0)"> =C2=A0 =C2=A0 =C2=A0 =C2=A0</span></span><span =
style=3D"color:rgb(128,128,0)"><span style=3D"color:rgb(0,0,136)">return</s=
pan></span><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(=
0,0,0)"> </span></span><span style><span style=3D"color:rgb(102,102,0)">*</=
span></span><span style=3D"color:rgb(128,0,0)"><span style=3D"color:rgb(0,0=
,0)">ptr</span></span><span style><span style=3D"color:rgb(102,102,0)">;</s=
pan></span></pre>
<pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)=
"> =C2=A0 =C2=A0</span></span><span style><span style=3D"color:rgb(102,102,=
0)">}</span></span></pre><pre><span style=3D"font-family:Arial,Helvetica,sa=
ns-serif;color:rgb(128,128,0)"><span style=3D"color:rgb(0,0,136)">private</=
span></span><span style=3D"font-family:Arial,Helvetica,sans-serif"><span st=
yle=3D"color:rgb(102,102,0)">:</span></span><span style><br>
</span></pre><pre><span style=3D"color:rgb(192,192,192)"><span style=3D"col=
or:rgb(0,0,0)">=C2=A0 =C2=A0 </span></span><span style=3D"color:rgb(128,128=
,0)"><span style=3D"color:rgb(0,0,136)">int</span></span><span style=3D"col=
or:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> </span></span><span =
style><span style=3D"color:rgb(102,102,0)">*</span></span><span style=3D"co=
lor:rgb(128,0,0)"><span style=3D"color:rgb(0,0,0)">ptr</span></span><span s=
tyle><span style=3D"color:rgb(102,102,0)">;</span></span></pre>
<pre><span style><span style=3D"color:rgb(102,102,0)">};</span></span></pre=
><div><pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(=
0,0,0)"><br>=C2=A0 =C2=A0 </span></span><span style=3D"color:rgb(128,128,0)=
"><span style=3D"color:rgb(0,0,136)">int</span></span><span style=3D"color:=
rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> </span></span><span sty=
le>main</span><span style><span style=3D"color:rgb(102,102,0)">()</span></s=
pan></pre>
<pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)=
"> =C2=A0 =C2=A0</span></span><span style><span style=3D"color:rgb(102,102,=
0)">{</span></span></pre><pre><span style=3D"color:rgb(192,192,192)"><span =
style=3D"color:rgb(0,0,0)"> =C2=A0 =C2=A0 =C2=A0 =C2=A0</span></span><span =
style=3D"color:rgb(128,0,128)"><span style=3D"color:rgb(102,0,102)">Foo</sp=
an></span><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0=
,0,0)"> </span></span><span style>a</span><span style><span style=3D"color:=
rgb(102,102,0)">(</span></span><span style=3D"color:rgb(0,0,128)"><span sty=
le=3D"color:rgb(0,102,102)">1</span></span><span style><span style=3D"color=
:rgb(102,102,0)">);</span></span></pre>
<pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)=
"> =C2=A0 =C2=A0 =C2=A0 =C2=A0</span></span><span style=3D"color:rgb(128,0,=
128)"><span style=3D"color:rgb(102,0,102)">Foo</span></span><span style=3D"=
color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> </span></span><sp=
an style>b</span><span style><span style=3D"color:rgb(102,102,0)">(</span><=
/span><span style=3D"color:rgb(128,0,128)"><span style=3D"color:rgb(0,0,0)"=
>std</span></span><span style><span style=3D"color:rgb(102,102,0)">::</span=
></span><span style>move</span><span style><span style=3D"color:rgb(102,102=
,0)">(</span></span><span style>a</span><span style><span style=3D"color:rg=
b(102,102,0)">));</span></span></pre>
<pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)=
"> =C2=A0 =C2=A0 =C2=A0 =C2=A0</span></span><span style=3D"color:rgb(128,0,=
128)"><span style=3D"color:rgb(0,0,0)">std</span></span><span style><span s=
tyle=3D"color:rgb(102,102,0)">::</span></span><span style>cout</span><span =
style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> </span><=
/span><span style><span style=3D"color:rgb(102,102,0)">&lt;&lt;</span></spa=
n><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> =
</span></span><span style>a</span><span style=3D"color:rgb(192,192,192)"><s=
pan style=3D"color:rgb(0,0,0)"> </span></span><span style><span style=3D"co=
lor:rgb(102,102,0)">&lt;&lt;</span></span><span style=3D"color:rgb(192,192,=
192)"><span style=3D"color:rgb(0,0,0)"> </span></span><span style=3D"color:=
rgb(0,128,0)"><span style=3D"color:rgb(0,136,0)">&quot;</span></span><span =
style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,136,0)"> </span=
></span><span style=3D"color:rgb(0,128,0)"><span style=3D"color:rgb(0,136,0=
)">&quot;</span></span><span style=3D"color:rgb(192,192,192)"><span style=
=3D"color:rgb(0,0,0)"> </span></span><span style><span style=3D"color:rgb(1=
02,102,0)">&lt;&lt;</span></span><span style=3D"color:rgb(192,192,192)"><sp=
an style=3D"color:rgb(0,0,0)"> </span></span><span style>b</span><span styl=
e=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> </span></spa=
n><span style><span style=3D"color:rgb(102,102,0)">&lt;&lt;</span></span><s=
pan style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> </sp=
an></span><span style=3D"color:rgb(128,0,128)"><span style=3D"color:rgb(0,0=
,0)">std</span></span><span style><span style=3D"color:rgb(102,102,0)">::</=
span></span><span style>endl</span><span style><span style=3D"color:rgb(102=
,102,0)">;</span></span></pre>
<span style><br></span><pre><span style=3D"color:rgb(192,192,192)"><span st=
yle=3D"color:rgb(0,0,0)">=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span></span><span st=
yle=3D"color:rgb(128,0,128)"><span style=3D"color:rgb(102,0,102)">Foo</span=
></span><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0=
,0)"> </span></span><span style>c</span><span style><span style=3D"color:rg=
b(102,102,0)">(</span></span><span style=3D"color:rgb(0,0,128)"><span style=
=3D"color:rgb(0,102,102)">2</span></span><span style><span style=3D"color:r=
gb(102,102,0)">);</span></span></pre>
<pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)=
"> =C2=A0 =C2=A0 =C2=A0 =C2=A0</span></span><span style>c</span><span style=
> </span><span><font color=3D"#666600">~ </font></span><span style>b</span>=
<span style><span style=3D"color:rgb(102,102,0)">;</span></span></pre>
<pre><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)=
"> =C2=A0 =C2=A0 =C2=A0 =C2=A0</span></span><span style=3D"color:rgb(128,0,=
128)"><span style=3D"color:rgb(0,0,0)">std</span></span><span style><span s=
tyle=3D"color:rgb(102,102,0)">::</span></span><span style>cout</span><span =
style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> </span><=
/span><span style><span style=3D"color:rgb(102,102,0)">&lt;&lt;</span></spa=
n><span style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> =
</span></span><span style>c</span><span style=3D"color:rgb(192,192,192)"><s=
pan style=3D"color:rgb(0,0,0)"> </span></span><span style><span style=3D"co=
lor:rgb(102,102,0)">&lt;&lt;</span></span><span style=3D"color:rgb(192,192,=
192)"><span style=3D"color:rgb(0,0,0)"> </span></span><span style=3D"color:=
rgb(0,128,0)"><span style=3D"color:rgb(0,136,0)">&quot;</span></span><span =
style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,136,0)"> </span=
></span><span style=3D"color:rgb(0,128,0)"><span style=3D"color:rgb(0,136,0=
)">&quot;</span></span><span style=3D"color:rgb(192,192,192)"><span style=
=3D"color:rgb(0,0,0)"> </span></span><span style><span style=3D"color:rgb(1=
02,102,0)">&lt;&lt;</span></span><span style=3D"color:rgb(192,192,192)"><sp=
an style=3D"color:rgb(0,0,0)"> </span></span><span style>b</span><span styl=
e=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> </span></spa=
n><span style><span style=3D"color:rgb(102,102,0)">&lt;&lt;</span></span><s=
pan style=3D"color:rgb(192,192,192)"><span style=3D"color:rgb(0,0,0)"> </sp=
an></span><span style=3D"color:rgb(128,0,128)"><span style=3D"color:rgb(0,0=
,0)">std</span></span><span style><span style=3D"color:rgb(102,102,0)">::</=
span></span><span style>endl</span><span style><span style=3D"color:rgb(102=
,102,0)">;</span></span></pre>
<span style><br></span><pre><span style=3D"color:rgb(192,192,192)"><span st=
yle=3D"color:rgb(0,0,0)"></span></span></pre></div></div></code></div></div=
></div></div></div></blockquote>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--047d7b675bf0002c5f04f4bad6cf--

.