Thursday, November 13, 2014

Digest for comp.lang.c++@googlegroups.com - 13 updates in 5 topics

comp.lang.c++@googlegroups.com Google Groups
Unsure why you received this message? You previously subscribed to digests from this group, but we haven't been sending them for a while. We fixed that, but if you don't want to get these messages, send an email to comp.lang.c+++unsubscribe@googlegroups.com.
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Nov 13 10:57AM -0800

On Thursday, November 13, 2014 1:45:02 PM UTC-5, JiiPee wrote:
> interesting, i need to learn to get the assembly code also to see these
> (is it some easy command on gcc?).
 
Yes. Add "-S -masm=intel" and it will generate disassembly in Intel
syntax. If you leave off the "-masm=intel" it will use AT&T syntax
and you'll go blind.
 
Best regards,
Rick C. Hodgin
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Nov 13 08:26PM

On 13/11/2014 18:09, Rick C. Hodgin wrote:
> I can only set goals. It is only He who gives me the ability to
> follow through on those goals. He may well have other plans for my
> life. Time will tell.
 
You don't get it do you mate? Designing a C-like language which treats
the simple expression (*o++) differently to C is both dumb and
dangerous; if you don't listen to what people say on this matter then
you are a fool and your language is a joke.
 
/Flibble
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Nov 13 12:31PM -0800

On Thursday, November 13, 2014 3:26:38 PM UTC-5, Mr Flibble wrote:
> dangerous; if you don't listen to what people say on this matter then
> you are a fool and your language is a joke.
 
> /Flibble
 
When compiled with -strict=c it will behave as C does. When compiled
without that flag, it will swap out that meaning and possibly some
others.
 
I am seriously considering changing the order of precedence on ++ and
--. We'll see though.
 
Best regards,
Rick C. Hodgin
David Brown <david.brown@hesbynett.no>: Nov 13 11:05PM +0100

On 13/11/14 19:26, JiiPee wrote:
>> Rick C. Hodgin
 
> ok, good to know. Well then I would still use myself ++tnX and just
> remember in debuggin mode this issue. But its a taste issue I guess....
 
There is no problem - just don't ask your compiler to run with its
shoelaces tied together. Even when debugging, there is seldom need to
have so little optimisation that the compiler generates worse code for
"++tnX" than "tnX + 1".
 
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Nov 13 10:33PM

On 13/11/2014 20:31, Rick C. Hodgin wrote:
> others.
 
> I am seriously considering changing the order of precedence on ++ and
> --. We'll see though.
 
Now I'm convinced you are just a troll.
 
/Flibble
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Nov 13 10:34PM

On 13/11/2014 22:05, David Brown wrote:
> shoelaces tied together. Even when debugging, there is seldom need to
> have so little optimisation that the compiler generates worse code for
> "++tnX" than "tnX + 1".
 
Give it up; this guy is obviously a troll.
 
/Flibble
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Nov 13 02:40PM -0800

On Thursday, November 13, 2014 5:33:14 PM UTC-5, Mr Flibble wrote:
> Now I'm convinced you are just a troll.
 
Well, here's something a troll would say: I am not a troll.
However, it also something a person who is not a troll would say.
 
I am not a troll. I am Rick C. Hodgin, a software developer from
Indianapolis, IN. I write low-level code and try very hard to
teach people about the Lord, and to follow Him in their lives, as
I try very hard to do in my life as well.
 
That the extent of it.
 
If you're ever in Indianapolis, contact me and we'll meet up and
you can talk to me face-to-face and see for yourself. I am a
normal human-looking person, in no way troll-like. :-)
 
http://www.visual-freepro.org/wiki/index.php/Rick_C._Hodgin
 
Well, maybe a little troll-like now that I look closely. :-)
 
Best regards,
Rick C. Hodgin
legalize+jeeves@mail.xmission.com (Richard): Nov 13 08:43PM

[Please do not mail me a copy of your followup]
 
no@notvalid.com spake the secret code
 
>I have been thinking of buying a new book (or 2 books) to learn
>everything about C++11 (preferably including 14 but its not essential as
>14 can be learned elsewhere I think as its not that different to 11).
 
Here are my recommendations.
 
"The C++ Programming Language", 4th ed., by Bjarne Stroustrup
<http://amzn.to/1GTvT2C>
 
"C++ Programming Language", 4th ed., is complete in covering
language features. He doesn't go into every single little
tiny detail of every library class, particularly when it comes
to discussing extension points (e.g. how to write your own
streambuf).
 
My only complaint with Stroustup's book is that I have the 2nd
printing and it has a large number of small typos, mostly in
the little code snippets. The explanations are fine and the
typos are not of the variety that it renders the code snippet
non-sensical but it is a distraction that occurs far too often
for my taste. Still, I got enjoyment from reading the latest
edition of this book. (I've read all the previous editions at
some point.) My only regret in purchasing it is that I wished
I was one of his reviewers to point out these typos while the
manuscript was in preparation :-).
 
"C++ Primer", 5th ed., by Stanley Lippman
<http://amzn.to/1xlI5GD>
 
A number of people have said that Stroustrup's style just
doesn't "gel" with them or they find it difficult to read.
Fortunately Stanley Lippman's "C++ Primer", 5th ed., seems to
provide that alternate perspective that reaches people who find
Stroustrup's style difficult. I had an older edition of this
book and I found it to be just fine, but since I didn't have
any problems with Stroustrup's presentation style, I gave my
copy away to someone so it would be put to better use.
 
"The C++ Standard Library", 2nd ed., by Nicolai Josuttis
<http://amzn.to/1xCeUO7>
 
This is the book I like For the standard library. The 2nd edition
has been updated for C++11. I used this book as the basis for
internal training on the whole standard library and I found it
to be great to learn from and to use as a reference I keep on my
desk.
 
"Standard C++ IOStreams and Locales"
<http://amzn.to/1u6MWrk>
 
AFAIK, this is the only book that really dives all the way down
the rabbit hole of locales and iostreams. Stroustrup covers the
basics enough for common use, so you don't need this book if you
just want to know how to do locale-specific input of numeric
quantiies. Not much (anything?) changed here with respect to
C++11, but it's nice to know about this book if you need to dive
down into this stuff beyond casual consumption of streams and the
occasional use of locale facets.
--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
The Computer Graphics Museum <http://computergraphicsmuseum.org>
The Terminals Wiki <http://terminals.classiccmp.org>
Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>
Jorgen Grahn <grahn+nntp@snipabacken.se>: Nov 13 09:24PM

On Thu, 2014-11-13, Stephen wrote:
>> (4th Edition)"? It is a really good book, but is there a better one? Or
>> another one beside it? I have its Third edition from 1996, but obviously
>> its very different I guess, so worth of buying?
 
The 4th has been reworked a lot; the new stuff isn't just introduced
in an appendix or something, but all the way through. So there are a
lot more curly brackets than in the earlier editions.
 
 
> I have the 2nd edition of Bjarnes "The C++ Programming Language" and
> it's hard work. The detail is in there, but his writing style does not
> gel with me. I'm assuming the later versions are better, maybe.
 
His style is the same. It took many years for me to appreciate it,
but it grows on you.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
"K' Dash" <adnanrashidpk@gmail.com>: Nov 13 11:10AM -0800

Dear fellows
 
bellow are the MAC address of my devices. I have a vector list std::vector<Maclist> m_listentry; in header file.
 
 
I want to create a function in which I want to push.back all the MAC addresses. My function is also here which is not finalize. please tell me how can I do this? if any one complete my function then I will be greatfull to him/her.
 
void
GUID_LMS_application::CreateLMSCache(Mac48Address mac, Ipv4Address ip)
{
for(int i=0; i<n; i++)
{


 
m_listentry.push_back ();
}
std::cout << "my server have the following MAC list of nodes \n" << m_listentry << "\n";
}
 
 
 
"00:00:00:00:00:01"
"00:00:00:00:00:02"
"00:00:00:00:00:03"
"00:00:00:00:00:04"
"00:00:00:00:00:05"
"00:00:00:00:00:06"
"00:00:00:00:00:07"
"00:00:00:00:00:08"
"00:00:00:00:00:09"
"00:00:00:00:00:0A"
"00:00:00:00:00:0B"
"00:00:00:00:00:0C"
"00:00:00:00:00:0D"
"00:00:00:00:00:0E"
"00:00:00:00:00:0F"
"00:00:00:00:00:10"
"00:00:00:00:00:11"
"00:00:00:00:00:12"
"00:00:00:00:00:13"
"00:00:00:00:00:14"
"00:00:00:00:00:15"
"00:00:00:00:00:16"
"00:00:00:00:00:17"
"00:00:00:00:00:18"
"00:00:00:00:00:19"
"00:00:00:00:00:1A"
"00:00:00:00:00:1B"
"00:00:00:00:00:1C"
"00:00:00:00:00:1D"
"00:00:00:00:00:1E"
"00:00:00:00:00:1F"
"00:00:00:00:00:20"
"00:00:00:00:00:21"
"00:00:00:00:00:22"
"00:00:00:00:00:23"
"00:00:00:00:00:24"
"00:00:00:00:00:25"
"00:00:00:00:00:26"
"00:00:00:00:00:27"
"00:00:00:00:00:28"
"00:00:00:00:00:29"
"00:00:00:00:00:2A"
"00:00:00:00:00:2B"
"00:00:00:00:00:2C"
"00:00:00:00:00:2D"
"00:00:00:00:00:2E"
"00:00:00:00:00:2F"
"00:00:00:00:00:30"
"00:00:00:00:00:31"
"00:00:00:00:00:32"
"00:00:00:00:00:33"
"00:00:00:00:00:34"
"00:00:00:00:00:35"
"00:00:00:00:00:36"
"00:00:00:00:00:37"
"00:00:00:00:00:38"
"00:00:00:00:00:39"
"00:00:00:00:00:3A"
"00:00:00:00:00:3B"
"00:00:00:00:00:3C"
"00:00:00:00:00:3D"
"00:00:00:00:00:3E"
"00:00:00:00:00:3F"
"00:00:00:00:00:40"
"00:00:00:00:00:41"
"00:00:00:00:00:42"
"00:00:00:00:00:43"
"00:00:00:00:00:44"
"00:00:00:00:00:45"
"00:00:00:00:00:46"
"00:00:00:00:00:47"
"00:00:00:00:00:48"
"00:00:00:00:00:49"
"00:00:00:00:00:4A"
"00:00:00:00:00:4B"
"00:00:00:00:00:4C"
"00:00:00:00:00:4D"
"00:00:00:00:00:4E"
"00:00:00:00:00:4F"
"00:00:00:00:00:50"
"00:00:00:00:00:51"
"00:00:00:00:00:52"
"00:00:00:00:00:53"
"00:00:00:00:00:54"
"00:00:00:00:00:55"
"00:00:00:00:00:56"
"00:00:00:00:00:57"
"00:00:00:00:00:58"
"00:00:00:00:00:59"
"00:00:00:00:00:5A"
"00:00:00:00:00:5B"
"00:00:00:00:00:5C"
"00:00:00:00:00:5D"
"00:00:00:00:00:5E"
"00:00:00:00:00:5F"
"00:00:00:00:00:60"
"00:00:00:00:00:61"
"00:00:00:00:00:62"
"00:00:00:00:00:63"
"00:00:00:00:00:64"
"00:00:00:00:00:65"
"00:00:00:00:00:66"
"00:00:00:00:00:67"
"00:00:00:00:00:68"
"00:00:00:00:00:69"
"00:00:00:00:00:6A"
"00:00:00:00:00:6B"
"00:00:00:00:00:6C"
"00:00:00:00:00:6D"
"00:00:00:00:00:6E"
"00:00:00:00:00:6F"
"00:00:00:00:00:70"
"00:00:00:00:00:71"
"00:00:00:00:00:72"
"00:00:00:00:00:73"
"00:00:00:00:00:74"
"00:00:00:00:00:75"
"00:00:00:00:00:76"
"00:00:00:00:00:77"
"00:00:00:00:00:78"
"00:00:00:00:00:79"
"00:00:00:00:00:7A"
"00:00:00:00:00:7B"
"00:00:00:00:00:7C"
"00:00:00:00:00:7D"
"00:00:00:00:00:7E"
"00:00:00:00:00:7F"
"00:00:00:00:00:80"
"00:00:00:00:00:81"
"00:00:00:00:00:82"
"00:00:00:00:00:83"
"00:00:00:00:00:84"
"00:00:00:00:00:85"
"00:00:00:00:00:86"
"00:00:00:00:00:87"
"00:00:00:00:00:88"
"00:00:00:00:00:89"
"00:00:00:00:00:8A"
"00:00:00:00:00:8B"
"00:00:00:00:00:8C"
"00:00:00:00:00:8D"
"00:00:00:00:00:8E"
"00:00:00:00:00:8F"
"00:00:00:00:00:90"
"00:00:00:00:00:91"
"00:00:00:00:00:92"
"00:00:00:00:00:93"
"00:00:00:00:00:94"
"00:00:00:00:00:95"
"00:00:00:00:00:96"
"00:00:00:00:00:97"
"00:00:00:00:00:98"
"00:00:00:00:00:99"
"00:00:00:00:00:9A"
"00:00:00:00:00:9B"
"00:00:00:00:00:9C"
"00:00:00:00:00:9D"
"00:00:00:00:00:9E"
"00:00:00:00:00:9F"
"00:00:00:00:00:A0"
"00:00:00:00:00:A1"
"00:00:00:00:00:A2"
"00:00:00:00:00:A3"
"00:00:00:00:00:A4"
"00:00:00:00:00:A5"
"00:00:00:00:00:A6"
"00:00:00:00:00:A7"
"00:00:00:00:00:A8"
"00:00:00:00:00:A9"
"00:00:00:00:00:AA"
"00:00:00:00:00:AB"
"00:00:00:00:00:AC"
"00:00:00:00:00:AD"
"00:00:00:00:00:AE"
"00:00:00:00:00:AF"
"00:00:00:00:00:B0"
"00:00:00:00:00:B1"
"00:00:00:00:00:B2"
"00:00:00:00:00:B3"
"00:00:00:00:00:B4"
"00:00:00:00:00:B5"
"00:00:00:00:00:B6"
"00:00:00:00:00:B7"
"00:00:00:00:00:B8"
"00:00:00:00:00:B9"
"00:00:00:00:00:BA"
"00:00:00:00:00:BB"
"00:00:00:00:00:BC"
"00:00:00:00:00:BD"
"00:00:00:00:00:BE"
"00:00:00:00:00:BF"
"00:00:00:00:00:C0"
"00:00:00:00:00:C1"
"00:00:00:00:00:C2"
"00:00:00:00:00:C3"
"00:00:00:00:00:C4"
"00:00:00:00:00:C5"
"00:00:00:00:00:C6"
"00:00:00:00:00:C7"
"00:00:00:00:00:C8"
"00:00:00:00:00:C9"
"00:00:00:00:00:CA"
"00:00:00:00:00:CB"
"00:00:00:00:00:CC"
"00:00:00:00:00:CD"
"00:00:00:00:00:CE"
"00:00:00:00:00:CF"
"00:00:00:00:00:D0"
"00:00:00:00:00:D1"
"00:00:00:00:00:D2"
"Öö Tiib" <ootiib@hot.ee>: Nov 12 04:39PM -0800

On Thursday, 13 November 2014 01:56:32 UTC+2, Richard wrote:
> >outside the translation unit.
 
> Agreed for static. Not so sure about const, but ISTR
> that there is some default linkage implications for const.
 
Yes, Paavo did quote the wording of standard even.
 
 
> Here's how I look at it: constants declared in a header
> are meant to be referenced from multiple translation
> units and the constant should follow ODR.
 
If that is your policy then you need some extra code
analyzer tool that warns about 'const' or 'constexpr'
without explicit 'extern' in header. C++ does not
check if things are in header or not in header (headers
are entirely business of language-unaware preprocessor)
and all the constants have internal linkage by default.
 
> application.
 
> The advice being violated here is that your header
> contains DEFINITIONS and not DECLARATIONS.
 
That can not be adviced in modern C++ because
increasing amount of things are templates and increasing amount of code is header-only. Linker has bit more work
to achieve actual ODR with inlines and templates but we
should not care about work-seconds of linker if we can
save work-hours of developers.
Paavo Helde <myfirstname@osa.pri.ee>: Nov 13 01:36AM -0600

legalize+jeeves@mail.xmission.com (Richard) wrote in news:m40s34$mq3$1
 
> Here's how I look at it: constants declared in a header are meant to
> be referenced from multiple translation units and the constant should
> follow ODR.
 
The constants are meant to be "used", not "referenced". You don't need to
keep around a reference or pointer to a const value as it cannot change
(legally).
 
> When you declare things static in the header, you end up
> with one definition per translation unit and depending on how often
> this header is included, you can end up with tons of data bloat.
 
The C++ rules for const namespace scope variables allow to optimize them
completely away in most cases where they are used, not to speak about the
TU-s where they are not used. Also the linker could presumably sometimes
merge different definitions into one.
 
I guess this works well for scalar types used by value, like int.
Declaring them extern and defining in a single TU would mean a
pessimization, as it would be then harder to inline the constant value
directly in the generated code.
 
For compound types this becomes more problematic, as these tend to be
used by references (e.g. const std::string&) and then it is probably
harder for the compiler+linker to optimize or merge them.
 
OTOH, declaring them extern does not really solve the problem either,
because they typically require dynamic initialization, so declaring them
extern could easily lead to "static initialization order fiasco".
 
Cheers
Paavo
Reinhardt Behm <rbehm@hushmail.com>: Nov 13 10:06AM +0800

Hongliang Wang wrote:
 
> is that I have not worked on Linux for more than one year so I forgot g++
> parameters. Could anybody tell me what I did wrong based on following make
> output? Thanks in advance.
 
<snip>
 
Why don't you use qmake. It will normally take care of setting up your
makefile with all needed options.
 
--
Reinhardt
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: