I've heard the phrase "Miranda function" used to refer to the 6 member
functions supplied by the compiler:
default constructor
copy constructor
destructor
operator=
operator& const
operator&
Does anyone know who was the first person to use that phrase?
I'd like to credit them in my training materials.
Thanks,
Robert Schwartz
Senior Instructor
Tessellation Training http://www.tessellation.com 15 2506
* Robert Allan Schwartz: I've heard the phrase "Miranda function" used to refer to the 6 member functions supplied by the compiler:
default constructor copy constructor destructor operator= operator& const operator&
The last two are not supplied by the compiler.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
In message <40****************@news.individual.net>, Alf P. Steinbach
<al***@start.no> writes * Robert Allan Schwartz: I've heard the phrase "Miranda function" used to refer to the 6 member functions supplied by the compiler:
default constructor copy constructor destructor operator= operator& const operator&
The last two are not supplied by the compiler.
So you can't take the address of an object of class type?
--
Richard Herring
* Richard Herring: In message <40****************@news.individual.net>, Alf P. Steinbach <al***@start.no> writes* Robert Allan Schwartz: I've heard the phrase "Miranda function" used to refer to the 6 member functions supplied by the compiler:
default constructor copy constructor destructor operator= operator& const operator&
The last two are not supplied by the compiler. So you can't take the address of an object of class type?
What do you mean, if anything?
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Robert Allan Schwartz posted: I've heard the phrase "Miranda function" used to refer to the 6 member functions supplied by the compiler:
default constructor copy constructor destructor operator= operator& const operator&
Does anyone know who was the first person to use that phrase?
I'd like to credit them in my training materials.
Thanks,
Robert Schwartz Senior Instructor Tessellation Training http://www.tessellation.com
Stephen R. Davis
Author of C++ for Dummies.
He says something like:
"...which I like to call the Miranda functions, ie. if you can't supply your
own, the court will supply them for you"
It's being a good while since I've read the book but that's the jist of it.
-JKop
In message <40****************@news.individual.net>, Alf P. Steinbach
<al***@start.no> writes * Richard Herring: In message <40****************@news.individual.net>, Alf P. Steinbach <al***@start.no> writes >* Robert Allan Schwartz: >> I've heard the phrase "Miranda function" used to refer to the 6 member >> functions supplied by the compiler: >> >> default constructor >> copy constructor >> destructor >> operator= >> operator& const >> operator& > >The last two are not supplied by the compiler. > So you can't take the address of an object of class type?
What do you mean, if anything?
I mean, if you have this,
class T {}
T a;
T * p = & a;
what makes the third line work? _I_ certainly didn't define
T::operator&().
--
Richard Herring al***@start.no (Alf P. Steinbach) wrote: * Robert Allan Schwartz: I've heard the phrase "Miranda function" used to refer to the 6 member functions supplied by the compiler:
default constructor copy constructor destructor operator= operator& const operator&
The last two are not supplied by the compiler.
I typically don't implement the address-of operators for the classes I write
but I still can take the address of the corresponding objects. Thus, it
seems that the compiler actually implements these methods. Without thinking
too hard about it, I can come up with at least one more function which is
also supplied by the compiler for all types: the comma operator. Also,
'operator new()' and 'operator delete()' are supplied. Of course, none of
these function is necessarily really generated but they are conceptually
used. ... and the supplied comma operator even follows ruls not available
to an explicit implementation (the order of argument evaluation). However,
the supplied constructors and destructors are also not necessarily generated.
--
<mailto:di***********@yahoo.com> <http://www.dietmar-kuehl.de/>
<http://www.contendix.com> - Software Development & Consulting
In message <ES**************@baesystems.com>, Richard Herring
<ju**@[127.0.0.1]> writes In message <40****************@news.individual.net>, Alf P. Steinbach <al***@start.no> writes* Richard Herring: In message <40****************@news.individual.net>, Alf P. Steinbach <al***@start.no> writes >* Robert Allan Schwartz: >> I've heard the phrase "Miranda function" used to refer to the 6 member >> functions supplied by the compiler: >> >> default constructor >> copy constructor >> destructor >> operator= >> operator& const >> operator& > >The last two are not supplied by the compiler. > So you can't take the address of an object of class type? What do you mean, if anything? I mean, if you have this,
class T {}
; // oops!T a; T * p = & a;
what makes the third line work? _I_ certainly didn't define T::operator&().
--
Richard Herring
* Richard Herring: In message <40****************@news.individual.net>, Alf P. Steinbach <al***@start.no> writes* Richard Herring: In message <40****************@news.individual.net>, Alf P. Steinbach <al***@start.no> writes >* Robert Allan Schwartz: >> I've heard the phrase "Miranda function" used to refer to the 6 member >> functions supplied by the compiler: >> >> default constructor >> copy constructor >> destructor >> operator= >> operator& const >> operator& > >The last two are not supplied by the compiler. > So you can't take the address of an object of class type? What do you mean, if anything? I mean, if you have this,
class T {}
You need a semicolon after that.
T a; T * p = & a;
what makes the third line work? _I_ certainly didn't define T::operator&().
Heh. The first four functions are "special member functions"
which the compiler generates if you don't define them yourself.
The special member functions are listed and discussed in §12,
which is titled "Special member functions".
The address operator is not a special member function, and no
address operator is generated by the compiler. I gather that
the "for dummies" book refererred to elsewhere in this thread
says otherwise. If so that's just Another Glaring Error (TM).
The third line of your example works the same as e.g. the
expression 2+x for int x, namely, it is directly translated by
the compiler. Note that the compiler knows the address. In a
reasonable implementation no code is generated for the operator
itself or its application, only for the usage of the result.
Perhaps you or the "for dummies" author have been misled by
§13.6/1 which states in a note that "because built-in operators
take only operands with non-class type, ...".
That wording is possibly a defect in the standard (it is
contradicted a large number of places including the definition of
the address operator and §13.3.1.2/9, "if the operator is the
operator ',', the unary operator '&', or the operator '->', and
there are no viable functions, then the operator is assumed to
be the built-in operator"); it was however not corrected in TC1.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
* Dietmar Kuehl: al***@start.no (Alf P. Steinbach) wrote: * Robert Allan Schwartz: I've heard the phrase "Miranda function" used to refer to the 6 member functions supplied by the compiler:
default constructor copy constructor destructor operator= operator& const operator& The last two are not supplied by the compiler.
I typically don't implement the address-of operators for the classes I write but I still can take the address of the corresponding objects.
That's according to §13.3.1.2/9, which says the built-in operator is used
if no viable function is found for operator ',', unary '&' or '->'.
Thus, it seems that the compiler actually implements these methods.
On the contrary.
The first four functions are special member functions (that's not my use of
"special" but the standard's terminology) which the compiler generate if you
don't define them; unary '&' is not a special member function.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
In message <40****************@news.individual.net>, Alf P. Steinbach
<al***@start.no> writes * Richard Herring: In message <40****************@news.individual.net>, Alf P. Steinbach <al***@start.no> writes >* Richard Herring: >> In message <40****************@news.individual.net>, Alf P. Steinbach >> <al***@start.no> writes >> >* Robert Allan Schwartz: >> >> I've heard the phrase "Miranda function" used to refer to the 6 member >> >> functions supplied by the compiler: >> >> >> >> default constructor >> >> copy constructor >> >> destructor >> >> operator= >> >> operator& const >> >> operator& >> > >> >The last two are not supplied by the compiler. >> > >> So you can't take the address of an object of class type? > >What do you mean, if anything? > I mean, if you have this,
class T {}
You need a semicolon after that.
True - corrected elsethread.
T a; T * p = & a;
what makes the third line work? _I_ certainly didn't define T::operator&(). Heh. The first four functions are "special member functions" which the compiler generates if you don't define them yourself. The special member functions are listed and discussed in §12, which is titled "Special member functions".
The address operator is not a special member function,
Granted. But I think you are the first to raise this concept.
and no address operator is generated by the compiler.
That's just semantics. The compiler certainly "supplies" the necessary
provision for the taking-the-address operation. Whether you can refer to
that as a built-in
I gather that the "for dummies" book refererred to elsewhere in this thread says otherwise. If so that's just Another Glaring Error (TM).
I wouldn't know about that. The third line of your example works the same as e.g. the expression 2+x for int x, namely, it is directly translated by the compiler.
Indeed. Is effect is to apply the operator + to two ints. Arguing about
whether operator+(int, int) really "exists" or is "built-in" is again
just a matter of semantics.
Note that the compiler knows the address. In a reasonable implementation no code is generated for the operator itself or its application, only for the usage of the result.
Nor is any code generated for the compiler-generated "destructor" in
many cases, so you can't use code generation as a test for the reality
of a function.
Perhaps you or the "for dummies" author have been misled by §13.6/1 which states in a note that "because built-in operators take only operands with non-class type, ...".
Not me. That wording is possibly a defect in the standard (it is contradicted a large number of places including the definition of the address operator and §13.3.1.2/9, "if the operator is the operator ',', the unary operator '&', or the operator '->', and there are no viable functions, then the operator is assumed to be the built-in operator"); it was however not corrected in TC1.
--
Richard Herring
* Richard Herring: >> >* Robert Allan Schwartz: >> >> I've heard the phrase "Miranda function" used to refer to the 6 member >> >> functions supplied by the compiler: >> >> >> >> default constructor >> >> copy constructor >> >> destructor >> >> operator= >> >> operator& const
Heh. The first four functions are "special member functions" which the compiler generates if you don't define them yourself. The special member functions are listed and discussed in §12, which is titled "Special member functions".
The address operator is not a special member function,
Granted. But I think you are the first to raise this concept.
To repeat myself, they're discussed in §12.
The address operator is not one, _and_ there are other operators
like the address operator not in the list given by Robert.
RTFM.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Alf P. Steinbach wrote: * Richard Herring: The address operator is not a special member function,
Granted. But I think you are the first to raise this concept.
To repeat myself, they're discussed in §12.
The address operator is not one, _and_ there are other operators like the address operator not in the list given by Robert.
The view that the address-of operator is magically supplied by the compiler is
not inaccurate from a certain point of view. At the same time, from a
technically accurate point of view, Alf is correct. As a proof, you can do
this:
struct X { };
X& (X::* pf)(const X&) = &X::operator=;
but you can't do this:
struct Y { };
Y* (Y::* pf)(void) = &Y::operator&;
Granted, you can't take the address of constructors and destructors, but *if*
you could, then those would work as well.
Regards,
Paul Mensonides
"Richard Herring" <ju**@[127.0.0.1]> wrote in message
news:1K**************@baesystems.com... In message <40****************@news.individual.net>, Alf P. Steinbach <al***@start.no> writes* Robert Allan Schwartz: I've heard the phrase "Miranda function" used to refer to the 6 member functions supplied by the compiler:
default constructor copy constructor destructor operator= operator& const operator&
The last two are not supplied by the compiler. So you can't take the address of an object of class type?
Yes you can, using the built-in address operator (&).
A member operator&() would overload the bitwise 'and' operator
for the class.
-Mike
In message <ZM*****************@newsread2.news.pas.earthlink. net>, Mike
Wahler <mk******@mkwahler.net> writes "Richard Herring" <ju**@[127.0.0.1]> wrote in message news:1K**************@baesystems.com... In message <40****************@news.individual.net>, Alf P. Steinbach <al***@start.no> writes >* Robert Allan Schwartz: >> I've heard the phrase "Miranda function" used to refer to the 6 member >> functions supplied by the compiler: >> >> default constructor >> copy constructor >> destructor >> operator= >> operator& const >> operator& > >The last two are not supplied by the compiler. > So you can't take the address of an object of class type?
Yes you can, using the built-in address operator (&).
A member operator&() would overload the bitwise 'and' operator for the class.
No, that would be T::operator&(const T&)
--
Richard Herring
"Mike Wahler" <mk******@mkwahler.net> wrote: * Robert Allan Schwartz: > I've heard the phrase "Miranda function" used to refer to the 6 member > functions supplied by the compiler: > > default constructor > copy constructor > destructor > operator= > operator& const > operator&
The last two are not supplied by the compiler. So you can't take the address of an object of class type?
Yes you can, using the built-in address operator (&).
A member operator&() would overload the bitwise 'and' operator for the class.
operator& with one parameter overloads bitwise and, but with no
parameter, overloads the address-of operator. This is used by
smart-pointer classes, for example. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Michael Stevens |
last post by:
Probably the wrong wording but since I'm not a scripter I won't claim
to know what I'm talking about.
I got this script from www.htmlgoodies.com
<script language="JavaScript">
<!--...
|
by: Clément Collin |
last post by:
I working on a GIS project, with Access link which just need a little
routine in VBA, but I haven't knowledges in VBA language.
It's very simple, and it looks like that in a TPascal way :
.......
|
by: murgan |
last post by:
Hi people,
i am new to this group,this is my first query,
friends i want to know the difference between "function pointer" and
"pointer to a function" in c lang, so friends please send the...
|
by: . |
last post by:
http://daviderognoni.blogspot.com?locawapp
- MAIN NEWS
===========
* add thread
* add "Request" object
* new "locawapp_main" function
* fixed files.py
|
by: Chen ShuSheng |
last post by:
HI,
I am now study a segment of codes:
------------------------
printf("%p\t",fp); /*add by me*/
fseek(fp, 0L, SEEK_END); /* go to end of file */
printf("%p\t",fp); ...
|
by: Benny Ng |
last post by:
Dear All,
Now I met one problem in the development of my one application.
I have one ASP.NET page. It's for disply the information of customer.
But now I have one new requirement. It's to...
|
by: whitsey |
last post by:
Trying to concatenate two fields into one however I seem unable to do
so.
All I want is to execute the following
SELECT MONTH(L.DATE) ||' '|| YEAR(L.DATE) as MTH_OF_YEAR
FROM LOG L
But I...
|
by: DR |
last post by:
when i build someone's project, and right click a function "goto definition"
is disabled. how to reconfigure a .net project to support "goto definition"
when i right click on function calls?
|
by: grbgooglefan |
last post by:
I am creating functions, the return result of which I am using to make
decisions in combined expressions.
In some expressions, I would like to inverse the return result of
function.
E.g....
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |