@Corona688, thank you for the reply. But even in the case when class B is not derived/inherited from A, and having the custom assignment operator implemented (like in the below code), then the B's overloaded assignment (only) is called.
All your operator= does is this:
No more, no less.
Overloading the default, means the default isn't called.
Quote:
my understanding was the user implemented overloaded assignment operator function will be invoked at the time when that class's object is assigned.
operator= is the thing which actually does assignment. Imagine the default as something like this:
When you overloaded it, you told it to do this instead:
When reading over some perl code in a software document, I came across an assignment statement like this
$PATH = ${PROJECT}/......./....
In this particular form of scalar variable assignment, what does the curly braces operators do ? Also, what is the benefit in doing scalar assignment this... (3 Replies)
Hello everyone!
Suppose that I have something like this
A a;
a.mem=new int;
A b = a;
where
class A {
public:
int * mem;
A() : mem(NULL) {
}
~A() {
if (mem!=NULL)
delete mem; (1 Reply)
1. List commands
to create the directory hierarchy $HOME/a/b/c
in vi to replace all occurences of TMP with tmp in lines 1 through 10
in vi to replace first occurence of CPU_file with DISK_file at line 15
2. Explain with a very simple example, usage of "ls -a"
3. What do the... (2 Replies)
Hi Folks,
I'm looking to figure something out in an existing script I'm trying to understand.
the command in question(on a Solaris Box using KSH) is: WORKDIR=/tmp/namereplaced.exec.$$.$RANDOM
Now, I know it's setting the $workdir environmental variable...
And I understand most of... (2 Replies)
Hello all im currently working on this assignment and a little stump on how to check for an argument heres the instructions:
Step 4:
Modify your script so that if there is an argument called TestError you display the following error message with your usage statement.
TestError found
Example:... (1 Reply)
Does anyone know how this line in bash works?
local gotbase= force= nicelevel corelimit
local pid base= user= nice= bg= pid_file=
local cgroup=
These lines are part of the daemon function inside the "functions" file at /etc/init.d in RH. (3 Replies)
I have a little code block (executing on AIX 7.1) that I cannot understand why the NOTFREE=0 does not appear to be assigned even though it goes through that block. This causes a unary operator issue.
#!/bin/bash
PLATFORM="AIX"
NEEDSPC=3000
set -x
if ; then
lsvg | grep -v rootvg | while... (6 Replies)
Discussion started by: port43
6 Replies
LEARN ABOUT CENTOS
qbitval
QBitVal(3qt)QBitVal(3qt)NAME
QBitVal - Internal class, used with QBitArray
SYNOPSIS
All the functions in this class are reentrant when Qt is built with thread support.</p>
#include <qbitarray.h>
Public Members
QBitVal ( QBitArray * a, uint i )
operator int ()
QBitVal & operator= ( const QBitVal & v )
QBitVal & operator= ( bool v )
DESCRIPTION
The QBitVal class is an internal class, used with QBitArray.
The QBitVal is required by the indexing [] operator on bit arrays. It is not for use in any other context.
See also Collection Classes.
MEMBER FUNCTION DOCUMENTATION QBitVal::QBitVal ( QBitArray * a, uint i )
Constructs a reference to element i in the QBitArray a. This is what QBitArray::operator[] constructs its return value with.
QBitVal::operator int ()
Returns the value referenced by the QBitVal.
QBitVal & QBitVal::operator= ( const QBitVal & v )
Sets the value referenced by the QBitVal to that referenced by QBitVal v.
QBitVal & QBitVal::operator= ( bool v )
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Sets the value referenced by the QBitVal to v.
SEE ALSO
http://doc.trolltech.com/qbitval.html http://www.trolltech.com/faq/tech.html
COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license
statement.
AUTHOR
Generated automatically from the source code.
BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you.
Thank you.
The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a
web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially
supported by Trolltech.
If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page
(qbitval.3qt) and the Qt version (3.3.8).
Trolltech AS 2 February 2007 QBitVal(3qt)