Which members are created automatically, which members are not inherited?

L

lovecreatesbeauty

Perhaps all C++ programmers are busy in designing their classes or get
into a deep sleep after a through night hard work. So I am willing to
ask the "off-topic" (perhaps not) question in this group. I think you
understand both C and C++ entirely, if not, why you still work on the C
programming language. And you are experts on both them, so it is not
off-topic at all. I need your help.

Please let us go into the topic.

I'm disturbed on this question for a long time. I think if I finally
get understand it with your kind help, I will get close to a excellent
C++ programmer. And I only can rely on your expertise and help. I've
read some books, but no book focuses on this. Don't you think it is a
very important thing of C++ programming language? So your knowledge is
of great benefit to others, especially me.


1. Which (How many) members will be created automatically?

Scott Meyers seems to give this list in a early print of his
<<effective C++, 2nd>>, but he removed 1 (or 2, perhaps you know it),
the list containing 6 members he gives is:

default constructor, copy constructor, destructor, assignment
operator, a pair of address-of operators (i.e. const, non-const) .

But in a later print (not a new edition, I don't read the 3rd one) he
removed the last pair of operators from that list without a detail
description, or he put that pair in that list before without a
thoroughly convinced reason. That is my complaint.

Dr. Bjarne Stroustrup mentioned operator , (i.e. comma) is also a
predefined member (he mentioned total 3: =, &, and , in TC++PL sec
11.2.2), but Andrew Koenig said "That is not a member function." in my
post before. Obviously, it is inside a class body, so I do not
understand what he said.

Herb Sutter mentioned &&, || and , (comma) in his new book C++ coding
standard. But he did not give a complete list of automatically created
class members also. He always talks about some magic things on usage of
vector, list or some similar things with gurus. That is my complaint.

How about new and delete, and some others functions or operators which
I do not know the name. Who will give a complete list?


2. Which (How many) members can not be inherited?

I know default ctor, copy ctor, dctor, assignment operator can not be
inherited. The first three members share the same name respectively
even the base class name and the derived class name are different - it
is obvious, but it helps me to understand the reason of non-inherited.
I can understand operator assignment will not be inherited also.

But I am not sure if there are other members also can not be inherited.

How about new and delete, and some others functions or operators which
I do not know the name. Who will give a complete list?


Sincerely,

lovecreatesbeauty
 
I

Ico

lovecreatesbeauty said:
Perhaps all C++ programmers ...

[...snipped a lot of stuff about classes, members, constructors ...]
... complete list?

I did not understand anything at all from your story, but that is
probably because it was all about the wrong language. I assume you ment
to send it to comp.lang.c++, but posted in the wrong group accidentally ?
 
V

Vladimir S. Oka

Ico said:
lovecreatesbeauty said:
Perhaps all C++ programmers ...

[...snipped a lot of stuff about classes, members, constructors ...]
... complete list?

I did not understand anything at all from your story, but that is
probably because it was all about the wrong language. I assume you
ment to send it to comp.lang.c++, but posted in the wrong group
accidentally ?

Please don't feed the troll. I found this bit (which you rightly
snipped) mildly insulting (to both c.l.c and c.l.c++, BTW):

BTW, someone in c.l.c had a nice ASCII art "do not feed the trolls" sig
a while ago. Can you post it again, please?

Cheers

Vladimir
 
L

lovecreatesbeauty

Vladimir said:
Please don't feed the troll. I found this bit (which you rightly
snipped) mildly insulting (to both c.l.c and c.l.c++, BTW):

No. I'm not. You're wrong.
I just want more help on my questions.
 
V

Vladimir S. Oka

lovecreatesbeauty said:
No. I'm not. You're wrong.
I just want more help on my questions.

An how exactly is deriding the language of choice in c.l.c going to
enamour you to the fine people here?

Don't bother to answer...

Bye

Vladimir
 
G

Grumble

Vladimir said:
BTW, someone in c.l.c had a nice ASCII art "do not feed the trolls"
sig a while ago. Can you post it again, please?


_____________________
/| /| | |
||__|| | Please do not |
/ O O\__ | feed the |
/ \ | Trolls |
/ \ \|_____________________|
/ _ \ \ ||
/ |\____\ \ ||
/ | | | |\____/ ||
/ \|_|_|/ | _||
/ / \ |____| ||
/ | | | --|
| | | |____ --|
* _ | |_|_|_| | \-/
*-- _--\ _ \ | ||
/ _ \\ | / `
* / \_ /- | | |
* ___ c_c_c_C/ \C_c_c_c____________



+-------------------+ .:\:\:/:/:.
| PLEASE DO NOT | :.:\:\:/:/:.:
| FEED THE TROLLS | :=.' - - '.=:
| | '=(\ 9 9 /)='
| Thank you, | ( (_) )
| Management | /`-vvv-'\
+-------------------+ / \
| | @@@ / /|,,,,,|\ \
| | @@@ /_// /^\ \\_\
@x@@x@ | | |/ WW( ( ) )WW
\||||/ | | \| __\,,\ /,,/__
\||/ | | | jgs (______Y______)
/\/\/\/\/\/\/\/\//\/\\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
==============================================================
 
V

Vladimir S. Oka

Grumble said:
_____________________
/| /| | |
||__|| | Please do not |
/ O O\__ | feed the |
/ \ | Trolls |
/ \ \|_____________________|
/ _ \ \ ||
/ |\____\ \ ||
/ | | | |\____/ ||
/ \|_|_|/ | _||
/ / \ |____| ||
/ | | | --|
| | | |____ --|
* _ | |_|_|_| | \-/
*-- _--\ _ \ | ||
/ _ \\ | / `
* / \_ /- | | |
* ___ c_c_c_C/ \C_c_c_c____________



+-------------------+ .:\:\:/:/:.
| PLEASE DO NOT | :.:\:\:/:/:.:
| FEED THE TROLLS | :=.' - - '.=:
| | '=(\ 9 9 /)='
| Thank you, | ( (_) )
| Management | /`-vvv-'\
+-------------------+ / \
| | @@@ / /|,,,,,|\ \
| | @@@ /_// /^\ \\_\
@x@@x@ | | |/ WW( ( ) )WW
\||||/ | | \| __\,,\ /,,/__
\||/ | | | jgs (______Y______)
/\/\/\/\/\/\/\/\//\/\\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
==============================================================

Thanks! I'll keep them safe (and hungry).

Vladimir
 
M

Martin Ambuhl

lovecreatesbeauty said:
I think you
understand both C and C++ entirely,

That is a bad assumption. Many of our posters are neophytes looking for
help, some of our expert regulars work in environments for which there
are no C++ compilers, and other expert regulars don't bother with the
byzantine features of C++
if not, why you still work on the C
programming language.

And that kind of "question" is flame-bait which should never be posted
to any language-specific newsgroup.
And you are experts on both them, so it is not
off-topic at all.

That is so fallacious it is hard to imagine anyone stupid enough to
write it. Most of us who post here regularly are experts in other
languages or in particular domain-specific topics. That expertise does
not make questions in those areas topical. The newsgroup is about C;
expertise in other areas cannot change that.
I need your help.

No shit.

[Questions about C++ snipped]
 
M

Mark McIntyre

BTW, someone in c.l.c had a nice ASCII art "do not feed the trolls" sig
a while ago. Can you post it again, please?

--

_____________________
/| /| | |
||__|| | Please do not |
/ O O\__ | feed the |
/ \ | Trolls |
/ \ \|_____________________|
/ _ \ \ ||
/ |\____\ \ ||
/ | | | |\____/ ||
/ \|_|_|/ | _||
/ / \ |____| ||
/ | | | --|
| | | |____ --|
* _ | |_|_|_| | \-/
*-- _--\ _ \ | ||
/ _ \\ | / `
* / \_ /- | | |
* ___ c_c_c_C/ \C_c_c_c____________
 
D

Default User

lovecreatesbeauty said:
Perhaps all C++ programmers are busy in designing their classes or get
into a deep sleep after a through night hard work. So I am willing to
ask the "off-topic" (perhaps not) question in this group. I think you
understand both C and C++ entirely, if not, why you still work on the
C programming language. And you are experts on both them, so it is not
off-topic at all. I need your help.

Fancy logic, but wrong. You won't get answers here, and you DID get
answers on comp.lang.c++, rather detailed ones.




Brian
 
C

CBFalconer

Vladimir S. Oka said:
.... snip ...

BTW, someone in c.l.c had a nice ASCII art "do not feed the
trolls" sig a while ago. Can you post it again, please?

Here's a couple of them. Enjoy.

_____________________
/| /| | F
||__|| | Please do not |
/ O O\__ | feed the |
/ \ | Trolls |
/ \ \|_____________________|
/ _ \ \ ||
/ |\____\ \ ||
/ | | | |\____/ ||
/ \|_|_|/ | _||
/ / \ |____| ||
/ | | | --|
| | | |____ --|
* _ | |_|_|_| | \-/
-- _--\ _ \ | ||
/ _ \\ | / `
/ \_ /- | | |
* ___ c_c_c_C/ \C_c_c_c____________

+-------------------+ .:\:\:/:/:.
| PLEASE DO NOT F :.:\:\:/:/:.:
| FEED THE TROLLS | :=.' - - '.=:
| | '=(\ 9 9 /)='
| Thank you, | ( (_) )
| Management | /`-vvv-'\
+-------------------+ / \
| | @@@ / /|,,,,,|\ \
| | @@@ /_// /^\ \\_\
@x@@x@ | | |/ WW( ( ) )WW
\||||/ | | \| __\,,\ /,,/__
\||/ | | | jgs (______Y______)
/\/\/\/\/\/\/\/\//\/\\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
==============================================================

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
 
K

Kenny McCormack

No. I'm not. You're wrong.
I just want more help on my questions.

I think I'm going to have to agree with you here.

You're not smart enough to be a troll. You're just an idiot.

- Trolls R Us -
- Trolls Local 202 -
 
V

Vladimir S. Oka

Kenny said:
- Trolls R Us -
- Trolls Local 202 -

I always thought that no self-respecting troll would ever admit to being
one!

;-) ;-)

Cheers

Vladimir
 
K

Kenny McCormack

I always thought that no self-respecting troll would ever admit to being
one!

;-) ;-)

In *this* NG, the trolls are the leading lights.
And that's no joke.
 
K

Keith Thompson

Vladimir S. Oka said:
Kenny McCormack wrote: [snip]

I always thought that no self-respecting troll would ever admit to being
one!

KM has long admitted to being a troll. Please either killfile him or
ignore him. I thought I hadn't seen very many posts from him lately;
perhaps ignoring him was actually working. Let's try it again.
 
V

Vladimir S. Oka

Keith said:
Vladimir S. Oka said:
Kenny McCormack wrote: [snip]

I always thought that no self-respecting troll would ever admit to
being one!

KM has long admitted to being a troll. Please either killfile him or
ignore him. I thought I hadn't seen very many posts from him lately;
perhaps ignoring him was actually working. Let's try it again.

You're right. I just couldn't resist the "Trolls R Us" bit. :-(

Cheers

Vladimir
 
K

Kenny McCormack

Vladimir S. Oka said:
Kenny McCormack wrote: [snip]

I always thought that no self-respecting troll would ever admit to being
one!

KM has long admitted to being a troll. Please either killfile him or
ignore him. I thought I hadn't seen very many posts from him lately;
perhaps ignoring him was actually working. Let's try it again.

You seem to have a real problem with me, don't you?

And I notice that *you* can't seem to stop responding to my posts/threads...
 
K

Keith Thompson

Vladimir S. Oka said:
Keith Thompson wrote: [...]
KM has long admitted to being a troll. Please either killfile him or
ignore him. I thought I hadn't seen very many posts from him lately;
perhaps ignoring him was actually working. Let's try it again.

You're right. I just couldn't resist the "Trolls R Us" bit. :-(

Please try harder. :-|
 
R

Rod Pemberton

Keith Thompson said:
Vladimir S. Oka said:
Keith Thompson wrote: [...]
KM has long admitted to being a troll. Please either killfile him or
ignore him. I thought I hadn't seen very many posts from him lately;
perhaps ignoring him was actually working. Let's try it again.

You're right. I just couldn't resist the "Trolls R Us" bit. :-(

Please try harder. :-|

What's your definition of a troll? I went and looked it up to see if it had
changed in fifteen years and it hadn't. It's a regular, who contributes
nothing, never learns to stop replying, and never leaves.

Look at your last seven posts: 6 complaints, 1 useful.

Now I'm being forced to become at troll. Perhaps you became a troll over
time and just didn't realize it. Take a look in the mirror.


Rod Pemberton
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,016
Latest member
TatianaCha

Latest Threads

Top