473,320 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Never seen this before ...

What does the second const in the member function prototype below
dprotect? I believe the first const prevents the reference returned
from being modified and the third prevents the member function from
modifying the object that invokes it. The compiler accepts the
statement below, so what does the second const protect?

const string const &getPartNumber()const;

Cheers,

Bob
Jun 27 '08 #1
27 1293
blangela wrote:
What does the second const in the member function prototype below
dprotect? I believe the first const prevents the reference returned
from being modified and the third prevents the member function from
modifying the object that invokes it. The compiler accepts the
statement below, so what does the second const protect?

const string const &getPartNumber()const;
It's a syntax error.

--
Ian Collins.
Jun 27 '08 #2
On Apr 14, 6:31*pm, Ian Collins <ian-n...@hotmail.comwrote:
blangela wrote:
What does the second const in the member function prototype below
dprotect? I believe the first const prevents the reference returned
from being modified and the third prevents the member function from
modifying the object that invokes it. *The compiler accepts the
statement below, so what does the second const protect?
const string const &getPartNumber()const;

It's a syntax error.

--
Ian Collins.
Then why does it compile without errors (there may be warnings - I
will have to check).

Bob
Jun 27 '08 #3
blangela wrote:
On Apr 14, 6:31 pm, Ian Collins <ian-n...@hotmail.comwrote:
>blangela wrote:
>>What does the second const in the member function prototype below
dprotect? I believe the first const prevents the reference returned
from being modified and the third prevents the member function from
modifying the object that invokes it. The compiler accepts the
statement below, so what does the second const protect?
const string const &getPartNumber()const;
It's a syntax error.
*Please* don't quote signatures.
>
Then why does it compile without errors (there may be warnings - I
will have to check).
#include <string>

struct X
{
const std::string const &getPartNumber()const;
};

CC z.cc
"z.cc", line 5: Error: "const" has already been included in this
declaration.

g++ /tmp/z.cc
/tmp/z.cc:5: error: duplicate `const'

--
Ian Collins.
Jun 27 '08 #4
On Apr 14, 6:52*pm, Ian Collins <ian-n...@hotmail.comwrote:
blangela wrote:
On Apr 14, 6:31 pm, Ian Collins <ian-n...@hotmail.comwrote:
blangela wrote:
What does the second const in the member function prototype below
dprotect? I believe the first const prevents the reference returned
from being modified and the third prevents the member function from
modifying the object that invokes it. *The compiler accepts the
statement below, so what does the second const protect?
const string const &getPartNumber()const;
It's a syntax error.

*Please* don't quote signatures.
Then why does it compile without errors (there may be warnings - I
will have to check).

#include <string>

struct X
{
* const std::string const &getPartNumber()const;

};

CC z.cc
"z.cc", line 5: Error: "const" has already been included in this
declaration.

g++ /tmp/z.cc
/tmp/z.cc:5: error: duplicate `const'

--
Ian Collins.
With my Microsoft VS 2008 Express C++ compiler I get:

"warning C4114: same type qualifier used more than once"

I should have looked closer at the warning messages before posting my
question.
Jun 27 '08 #5
Ian Collins <ia******@hotmail.comwrote in news:66ig2iF2kg6m6U28
@mid.individual.net:
*Please* don't quote signatures.
Annoying, huh? Of course, one solution is to not attach the superfluous
bandwidth wasting signature in the first place, since your name already
appears in the header and, in this case, the attribution. How many times
do you need to see your name in lights when you post?
Jun 27 '08 #6
On Apr 15, 7:36*am, Michael DOUBEZ <michael.dou...@free.frwrote:
I don't see the problem, Netiquette doesn't forbid signatures (4 lines
is the line).
A rather arbitrary rule.
But, trimming a text correctly before sending it is part of the good
usage of USENET.
Whatever. 1 in 1000 posts may exhibit this "problem", while 995
contain sigs in the first place, because some arbitrary "netiquette"
guideline says it's OK to waste four lines per post.
Jun 27 '08 #7
On Apr 15, 10:17*am, Michael DOUBEZ <michael.dou...@free.frwrote:
The culture says so. If you are not happy, make a proposal to change a
30 year old practice.
Make a proposal to whom? Who owns Usenet and creates and enforces
these guidelines? Who decides what they are?

Jun 27 '08 #8
lb*******@yahoo.com wrote:
Make a proposal to whom? Who owns Usenet and creates and enforces
these guidelines? Who decides what they are?
Those who do not listen to your prattling.

Jun 27 '08 #9
Michael DOUBEZ wrote:

I don't see the problem, Netiquette doesn't forbid signatures (4
lines is the line). All the most when it is preceded by two dash and
a blank that indicate to the newsreader to cut off the signature.

But, trimming a text correctly before sending it is part of the good
usage of USENET.
The problem occurs mainly (but not exclusively) in posts from Google
Groups. In yet another of it's less than perfect aspects, it doesn't
automatically trim .sigs, the way most newsreaders will.


Brian
Jun 27 '08 #10
On Apr 15, 11:32*am, Matthias Buelow <m...@incubus.dewrote:
lbonaf...@yahoo.com wrote:
Make a proposal to whom? *Who owns Usenet and creates and enforces
these guidelines? *Who decides what they are?

Those who do not listen to your prattling.
Why the personal attack? I researched posting guidelines and found
nothing written about quoting signatures, nor any authority by those
who wrote them.

And by the way, I follow the guidelines and indeed said that it is
annoying when people quote sigs, I just find it odd that one thinks
sigs themselves are OK because "it is written".

Written by someone nobody can identify, apparently.
Jun 27 '08 #11
lb*******@yahoo.com wrote:
On Apr 15, 11:32 am, Matthias Buelow <m...@incubus.dewrote:
lbonaf...@yahoo.com wrote:
Make a proposal to whom? Who owns Usenet and creates and enforces
these guidelines? Who decides what they are?
Those who do not listen to your prattling.

Why the personal attack? I researched posting guidelines and found
nothing written about quoting signatures, nor any authority by those
who wrote them.

And by the way, I follow the guidelines and indeed said that it is
annoying when people quote sigs, I just find it odd that one thinks
sigs themselves are OK because "it is written".

Written by someone nobody can identify, apparently.
The Network Working Group for the most part, codified through the RFCs.
You couldn't have done much "research" if you failed to discover that.


Brian
Jun 27 '08 #12
"Default User" <de***********@yahoo.comwrote in
news:66*************@mid.individual.net:
lb*******@yahoo.com wrote:
>And by the way, I follow the guidelines and indeed said that it is
annoying when people quote sigs, I just find it odd that one thinks
sigs themselves are OK because "it is written".

Written by someone nobody can identify, apparently.

The Network Working Group for the most part, codified through the
RFCs. You couldn't have done much "research" if you failed to discover
that.
Sorry, this really isn't important enough to explore that deeply, so
maybe "research" was a bad choice of words.

OK, so I found it here, written in 1995 by one S. Hambridge of Intel:

http://www.faqs.org/rfcs/rfc1855.html

"This document provides a minimum set of guidelines for Network
Etiquette (Netiquette) which organizations may take and adapt for
their own use."

Sorry, seems pretty arbitrary and definitely optional.
Jun 27 '08 #13
Lloyd Bonafide wrote:
Ian Collins <ia******@hotmail.comwrote in news:66ig2iF2kg6m6U28
@mid.individual.net:
>*Please* don't quote signatures.

Annoying, huh? Of course, one solution is to not attach the superfluous
bandwidth wasting signature in the first place, since your name already
appears in the header and, in this case, the attribution. How many times
do you need to see your name in lights when you post?
If I signed my posting in the body of the message, everyone would have
to trim it. The point of signatures and the signature delimiter is
proper news readers snip them and format them correctly.

This worked fine until google came along and decided to ignore Usenet
convention. Not only does their abomination of an interface not snip
signatures, it thwarts attempts by its unfortunate users to include a
correctly formatted one.

--
Ian Collins.
Jun 27 '08 #14
On 15 avr, 23:46, Lloyd Bonafide <nos...@nicetry.orgwrote:
"Default User" <defaultuse...@yahoo.comwrote
innews:66*************@mid.individual.net:
lbonaf...@yahoo.com wrote:
And by the way, I follow the guidelines and indeed said that it is
annoying when people quote sigs, I just find it odd that one thinks
sigs themselves are OK because "it is written".
Written by someone nobody can identify, apparently.
The Network Working Group for the most part, codified through the
RFCs. You couldn't have done much "research" if you failed to discover
that.
Sorry, this really isn't important enough to explore that deeply, so
maybe "research" was a bad choice of words.
OK, so I found it here, written in 1995 by one S. Hambridge of Intel:
http://www.faqs.org/rfcs/rfc1855.html
"This document provides a minimum set of guidelines for Network
Etiquette (Netiquette) which organizations may take and adapt for
their own use."
Sorry, seems pretty arbitrary and definitely optional.
An RFC, and you say "definitely optional"? Despite the name
(Request For Comments), RFC's are the official standards for the
net.

For the record, it's generally considered desirable that all
pertinent information be found in the body of the posting, and
that you don't have to look in the headers to find additional
information. It was also considered desirable that people could
identify them as people in email and postings, with their real
names (and addresses, and phone numbers, if they wanted), and
not just their login ids. This motivated the original creation
of the signature. When (some) people started abusing (with
signatures of over a hundred lines at times, complete with ASCII
art), the people responsible for the net decided to draw a line.
The exact value is 4 lines; more is formally considered abuse.
In practice, however, if you happen to have five, I don't think
there'd be much complaint (except that a good newsreader or
email client won't send the message).

Similarly, other standard practices evolved. They don't have
the force of law, but they are respected by civilized net
citizens.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jun 27 '08 #15
On 15 avr, 18:44, "Default User" <defaultuse...@yahoo.comwrote:
Michael DOUBEZ wrote:
I don't see the problem, Netiquette doesn't forbid signatures (4
lines is the line). All the most when it is preceded by two dash and
a blank that indicate to the newsreader to cut off the signature.
But, trimming a text correctly before sending it is part of the good
usage of USENET.
The problem occurs mainly (but not exclusively) in posts from Google
Groups. In yet another of it's less than perfect aspects, it doesn't
automatically trim .sigs, the way most newsreaders will.
The problem was present long before Google groups---I don't
think Outlook Explorer trims sigs either (or at least, it didn't
at one time).

But that's really shoving off the blame. For various reasons, I
post through Google groups, but you won't find quoted signatures
in my postings (unless I slip up). Google groups does have a
lot of problems, but this one is easy to avoid. (Note that if
you're a responsible poster, you'll be trimming anyway. Whether
the sig is there or not really doesn't make much difference.)

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jun 27 '08 #16
James Kanze wrote:
>
But that's really shoving off the blame. For various reasons, I
post through Google groups, but you won't find quoted signatures
in my postings (unless I slip up). Google groups does have a
lot of problems, but this one is easy to avoid. (Note that if
you're a responsible poster, you'll be trimming anyway. Whether
the sig is there or not really doesn't make much difference.)
But should you knowingly post a broken signature?

--
Ian Collins.
Jun 27 '08 #17
James Kanze wrote:
On 15 avr, 18:44, "Default User" <defaultuse...@yahoo.comwrote:
Michael DOUBEZ wrote:
I don't see the problem, Netiquette doesn't forbid signatures (4
lines is the line). All the most when it is preceded by two dash
and a blank that indicate to the newsreader to cut off the
signature.
But, trimming a text correctly before sending it is part of the
good usage of USENET.
The problem occurs mainly (but not exclusively) in posts from Google
Groups. In yet another of it's less than perfect aspects, it doesn't
automatically trim .sigs, the way most newsreaders will.

The problem was present long before Google groups---I don't
think Outlook Explorer trims sigs either (or at least, it didn't
at one time).

But that's really shoving off the blame. For various reasons, I
post through Google groups, but you won't find quoted signatures
in my postings (unless I slip up).
I didn't state, and didn't intend to imply, that all GG posters do so.
I'm also aware that not all newsreaders auto-trim. However, if you do
count, I'll think you find that the overwhelming majority of posted
..sigs comes from GG users. That's why I said, "mainly (but not
exclusively)".


Brian

Jun 27 '08 #18
On Tue, 15 Apr 2008 09:50:05 -0700 (PDT), lb*******@yahoo.com wrote:
>I researched posting guidelines and found
nothing written about quoting signatures, nor any authority by those
who wrote them.
"researched posting guidelines" HA HA!

There is no such thing as "posting guidelines" or "authority." You
post whatever you want, and quote whatever you want. If you are a bad
poster and make your post hard to read and follow, you are hurting
yourself only. People will skim and ignore the post. That's all there
is to this. There is no other guidelines and authorities.

Anyway, what does this discussion has to do with C++? Shame on you.
You are off-topic. Read the FAQ.

Jun 27 '08 #19
James Kanze <ja*********@gmail.comwrote in news:b75988c3-f457-4369-
bb***************@f36g2000hsa.googlegroups.com:
An RFC, and you say "definitely optional"? Despite the name
(Request For Comments), RFC's are the official standards for the
net.
Really? Then why does this one begin with this:
Status of This Memo

This memo provides information for the Internet community. This memo
does not specify an Internet standard of any kind. Distribution of
this memo is unlimited.

Abstract

This document provides a minimum set of guidelines for Network
Etiquette (Netiquette) which organizations may take and adapt for
their own use.

Jun 27 '08 #20
On Apr 16, 4:32 am, Lloyd Bonafide <nos...@nicetry.orgwrote:
James Kanze <james.ka...@gmail.comwrote in news:b75988c3-f457-4369-
bb9e-5157aa7f3...@f36g2000hsa.googlegroups.com:
An RFC, and you say "definitely optional"? Despite the name
(Request For Comments), RFC's are the official standards for the
net.
Really? Then why does this one begin with this:
Status of This Memo
This memo provides information for the Internet community. This memo
does not specify an Internet standard of any kind. Distribution of
this memo is unlimited.
Because it doesn't place any formal constraints on software
connecting to the net.
Abstract
This document provides a minimum set of guidelines for Network
Etiquette (Netiquette) which organizations may take and adapt for
their own use.
Exactly. It's *minimum* set of guidelines. Organizations may
place stricter restrictions. And of course, because it's the
Internet, you won't go to jail for violating them.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Jun 27 '08 #21
Michael DOUBEZ <mi************@free.frwrote in
news:48**********************@news.free.fr:

Of course it is not a standard but IPv4, IPv6, TCP, UDP, HTTP, FTP ...
Most of Internet, network and serial communication protocols have been
standardized through the RFC. And not all RFC are standards, some are
drafts ... You might want to have a deeper look before drawing
conclusion.

Only the most perverted mind would want to standardize behavior. It is
stated as guidelines. Those are rules commonly accepted (like a chart)
but there is no authority to enforce them except the community. The
rules are here to regulate the communication such that the information
rate stays acceptable. Trolls are known to use 100 or more lines in
their signature.

I don't disagree with what you say, and in fact it reinforces my
original complaint - that .sigs were somehow kosher, but quoting them is
not because of some non-binding text called an RFC, which in the case of
posting guidelines, is an abbreviation for "somebody's opinion".

On one hand, you guys say suggest that RFCs are mere suggestions, on the
other they seem to hold some authority. Frankly, it smacks of
religion.

Jun 27 '08 #22
In article <Xn*******************************@194.177.96.26 >,
no****@nicetry.org says...

[ ... ]
On one hand, you guys say suggest that RFCs are mere suggestions, on the
other they seem to hold some authority. Frankly, it smacks of
religion.
Hardly. The simple fact is that some RFCs are "standards track" and
really do hold some authority. Other RFCs are not, and have less
authority.

Realistically, IETF in its entirety has very little in the way of real
authority. Almost all RFCs are really just guidelines that allow people
to get things to work together.

In some cases, failing to follow them will result in things not working
at all -- e.g. it's an RFC that says what port your DNS client should
use to talk to a DNS server. If you write a client that tries to use a
different port number, it's almost certain that it will not work with
any RFC-compliant DNS server.

In other cases, the system is sufficiently resilient to keep working to
some degree even when the RFC is ignored. This case is a bit like that:
quoting .sig's is asinine wasteful and stupid, but isn't quite bad
enough to completely stop the system from working at all.

--
Later,
Jerry.

The universe is a figment of its own imagination.
Jun 27 '08 #23
On Apr 16, 9:10*am, Jerry Coffin <jcof...@taeus.comwrote:
quoting .sig's is asinine wasteful and stupid,
And including .sigs is virtuous because some guy said they were in an
RFC? "Later, Jerry" is somehow not wasteful on every single post you
make?

Anyway, hold onto your dogma. I'm not trying to take it way, just
pointing out the hypocrisy.

Jun 27 '08 #24
lb*******@yahoo.com wrote:

Anyway, hold onto your dogma. I'm not trying to take it way, just
pointing out the hypocrisy.

About enough of this troll.
*plonk*


Brian
Jun 27 '08 #25
In article <1d0eccf5-0cdc-4458-a40f-
db**********@b1g2000hsg.googlegroups.com>, lb*******@yahoo.com says...
On Apr 16, 9:10Â*am, Jerry Coffin <jcof...@taeus.comwrote:
quoting .sig's is asinine wasteful and stupid,
And including .sigs is virtuous because some guy said they were in an
RFC?
No -- limiting them is virtuous.
"Later, Jerry" is somehow not wasteful on every single post you
make?
IMO, no. Signing what you do (electronically or otherwise) isn't
wasteful at all.
Anyway, hold onto your dogma. I'm not trying to take it way, just
pointing out the hypocrisy.
You can try, and it's unlikely that anybody will stop you. OTOH, the
newsgroup does have a topic, and spending all your time being asinine
will only get you plonked. The result is obvious and nearly inevitable:
when/if you do have something to say or ask that's topical, nobody will
listen or reply.

--
Later,
Jerry.

The universe is a figment of its own imagination.
Jun 27 '08 #26
On Apr 15, 2:54*pm, Ian Collins <ian-n...@hotmail.comwrote:
Lloyd Bonafide wrote:
Ian Collins <ian-n...@hotmail.comwrote in news:66ig2iF2kg6m6U28
@mid.individual.net:
*Please* don't quote signatures.
Annoying, huh? *Of course, one solution is to not attach the superfluous
bandwidth wasting signature in the first place, since your name already
appears in the header and, in this case, the attribution. *How many times
do you need to see your name in lights when you post? *

If I signed my posting in the body of the message, everyone would have
to trim it. *The point of signatures and the signature delimiter is
proper news readers snip them and format them correctly.

This worked fine until google came along and decided to ignore Usenet
convention. *Not only does their abomination of an interface not snip
signatures, it thwarts attempts by its unfortunate users to include a
correctly formatted one.
I did not mean to make such a fuss!!!

Only looked back at this thread now that I started several days ago
was quite amazed. I actually though the high number of replies were
discussing how Microsoft handles the syntax error. Foolish me.

I do use google as my usenet browser, so I guess this is why it
happened (my bad ediquette).

When I created this reply, I deleted the last 2 quoted lines that
included Ian's name. Is that what I was supposed to have done in the
first place? I will try to remember to do so in the future.

Again, sorry to have unintentionally created such a fuss.

Bob
Jun 27 '08 #27
On 16 Apr, 13:29, Michael DOUBEZ <michael.dou...@free.frwrote:
On one hand, you guys say suggest that RFCs are mere suggestions, on the
other they seem to hold some authority. * Frankly, it smacks of
religion.

I don't know what 'smack' means (smell?).
pretty good guess! I'm a native english speaker and I knew what is
meant
but for a precise definition I had to look it up.

Smack \Smack\, n. [OE. smak, AS. ssm?c taste, savor; akin to D.
smaak, G. geschmack, OHG. smac; cf. Lith. smagus pleasant.
Cf. Smack, v. i.]
1. Taste or flavor, esp. a slight taste or flavor; savor;
tincture; as, a smack of bitter in the medicine. Also used
figuratively.
[1913 Webster]
--
Nick Keighley
Jun 27 '08 #28

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sharron | last post by:
All I need some help...I have never seen the code below before and need to know what is the formal name for what the constructor statement below is doing (if I have the formal name then I can look...
0
by: Ray Mitchell | last post by:
This is probably a IDE bug. I manually told it to recompile everything and it then worked properly. I've seen this before in VS6 as well as now in VS .NET where the IDE sometimes loses track of...
5
by: Felix I. Wyss | last post by:
Good Afternoon, I recently noticed that some very simple methods of a template declared and used in a DLL library get inlined when used by the DLL itself, but not by other DLLs and EXEs. After...
2
by: David | last post by:
I was experimenting with generating a Word file using ASP.NET, and lauching the web app did not cause any problems. Then out of the blue, this is happening to every asp.net app that I attempt to...
3
by: Grigs | last post by:
Hello, I have a web service that reads its web.config file to connect to an Oracle database. There are a number of methods in this socalled BACKBONE that either send inforomation to or from the...
2
by: MLH | last post by:
I invoked the combo-box wizard today, telling it to use a 4-table union query as a row-source for the combo-box it was assisting me in building. The error I got was without number and stated,...
14
by: lovecreatesbeauty | last post by:
Sometimes programmers will define macros at command line like: $ gcc -DF1_H ... $ gcc -DF1_H=0 ... $ gcc -DF1_H=1 ... One of following three lines labeled as #1, #2, #3 may provide #include...
56
by: xlar54 | last post by:
I've been going through the newsgroup, picking up best practices and things not to do, as I think it helps to make a good programmer a very good one. But rather than fishing, I figure that there...
1
by: rengaraj | last post by:
I have the following try/catch block: try { netscape.javascript.JSObject.getWindow(this.applet).eval("ClkExcept(" + nId.toString() + ")"); ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.