THIS C++ "May 18, 2001" "" "C++ Library"
NAME
this - pointer
DESCRIPTION
The this pointer is a special pointer that exists for a class
while a nonstatic member function is executing. It is a pointer
to an object of the type of the class, and it points to the
object for which the member function currently is executing.
.br
11111
void Date::month_display()
{
// These two statements do the same thing.
cout << month;
cout << this -> month;
}
22222
One use of this pointer allows member functions to return
the invoking objet (or its address or a reference to it)
to the caller.
EXAMPLE
EXAMPLEMARK
// Overloaded Date assignment.
Date& Date::operator=(const Date& dt)
{
if (this != &dt)
{
mo = dt.mo;
da = dt.da;
yr = dt.yr;
delete [] month;
if (dt.month != 0)
{
month = new char [strlen(dt.month)+1];
strcpy(month, dt.month);
}
else
month = 0;
}
return *this;
}
EXAMPLEMARK
AUTHOR
1s/^\(.*\)$/\.TH \1/
/NAME/s/^\(.*\)$/\.SH \1/
/DESCRIPTION/s/^\(.*\)$/\.SH \1/
/\<EXAMPLE\>/s/^\(.*\)$/\.SH \1/
/AUTHOR/s/^\(.*\)$/\.SH \1/
s/this/\\fIthis\\fR/g
/11111/,/22222/{
a\
.br
}
/EXAMPLEMARK/,/EXAMPLEMARK/{
a\
.br
}
/EXAMPLEMARK/s///
/11111/s///
/22222/s///
/SEE ALSO/,/AUTHOR/{
/^[a-z]/s/^\(.*\)$/\.BR \1/
s/(\([1-9]\))/ "(\1), "/g
s/(C++)/ "(C++), "/g
s/(C++)$/ "(C++)"/
}
/AUTHOR/{
i\
a\
\\fIA\\fRnatoliy\ \\fIU\\fRrbanskiy
}
If you have a root privileges, you can put this page into particular subman directory,
or even create new one. If you create new sub directory ( like in my case, I created manC++ sub directory
inside of /usr/share/man directory ), you have to add in MANSECT the name of your new section
(in my case it is 'C++', without man!).
The MANSECT is in file /etc/manpath.config or /etc/man.config ( depends from system ).
After this, as root you should run
updatedb command.