- enum class or enum? - 3 Updates
- Read again, here is my final post about what is it to be smart ? - 2 Updates
- who's at fault, me or compiler? - 5 Updates
- This was my last post here in this newsgroup of C++ - 2 Updates
- Read again, i correct about Delphi and Freepascal and volatile and safety.. - 2 Updates
- Available C++ Libraries FAQ - 1 Update
- "Two new Keywords in C++20: consteval and constinit" - 1 Update
- Is this undefined behavior? - 1 Update
- What is it to be smart ? - 1 Update
Bo Persson <bo@bo-persson.se>: Jul 16 09:32AM +0200 On 2020-07-15 at 18:18, JiiPee wrote: > board[4] = X; > So that things are more compact? Putting Piece::X makes things a bit too > long? I know its safer, but also it makes things longer... Who says that shorter is better? Using P and b, instead of Piece and board, would make it even shorter - but in no way better. Bo Persson |
Juha Nieminen <nospam@thanks.invalid>: Jul 16 08:09AM > Quick question. Sometimes I think whether to use enum class or enum. Old-style enum, which was inherited from C, is essentially just almost purely syntactic sugar for declaring compile-time int constants. While not exactly the same thing (even in C), an enum like enum Name { value1, value2, value3 }; is almost the same thing as saying typedef int Name; const int value1 = 0, value2 = 1, value3 = 2; (Yes, it's not *exactly* the same thing, even in C, but in most practical situations you can consider them the same thing.) In most situations this is a bit problematic because all those names end up in the surrounding scope (often the global namespace, if you declare that enum in that scope). In order to minimize naming collisions you usually want to manually prefix all those names, by naming them like enum Name { Name_value1, Name_value2, Name_value3 }; or similar. Strongly-typed enums (ie. "enum class") add modularity by not contaminating the surrounding scope with all those names, and make the enumerated type an actual user-defined type, rather than it being just an alias for an int. Nevertheless, there are situations where old-style enums can be more practical. After all, they are just effectively ints, and sometimes that's useful. Namely, you can directly do arithmetic with them, while the same is not possible (on purpose) with strongly-typed enums, without an explicit cast to int (which makes it more awkward). Most particularly, old-style enumerated values can be used as-is to index an array, while strongly-typed enumerated values cannot (without an explicit cast). Sometimes being able to index an array with enumerated names can be handy (when those names refer to elements of an array). Unfortunately there is no best-of-both-worlds alternative, ie. a "mixed" style enumerated value which are inside the namespace scope of the enum type but can be be used for integer arithmetic and array indexing as-is without an explicit cast. I suppose the closest you can get to that is by putting the old-style enum inside a namespace (but then you can't use the name of that namespace as the name of the enumerated type). |
JiiPee <no@notvalid.com>: Jul 16 08:17PM +0100 On 16/07/2020 09:09, Juha Nieminen wrote: > const int value1 = 0, value2 = 1, value3 = 2; > (Yes, it's not *exactly* the same thing, even in C, but in most practical > situations you can consider them the same thing.) yes > an array, while strongly-typed enumerated values cannot (without an explicit > cast). Sometimes being able to index an array with enumerated names can be > handy (when those names refer to elements of an array). ok, this I also have been thinking. enum class makes it a bit difficult |
"😉 Good Guy 😉" <Hello.World@example.com>: Jul 15 09:50PM -0400 > X-Received-Bytes: 7508 > X-Received-Body-CRC: 1601465856 > Xref: aioe.org comp.lang.c++:121453 Please report this spammer to: OrgAbuseHandle: ABUSE263-ARIN OrgAbuseName: Network Operations Center OrgAbusePhone: +1-514-281-8498 OrgAbuseEmail: abuse@videotron.ca Send full headers so that they can terminate his account. |
Scott Newman <scott69@gmail.com>: Jul 16 07:03PM +0200 > OrgAbusePhone: +1-514-281-8498 > OrgAbuseEmail: abuse@videotron.ca > Send full headers so that they can terminate his account. Please not, his posts are ingenious. |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Jul 14 10:38AM +0100 > return 0; > } > And here are the relevant assembly instructions. Notice anything? And it is likely that the following code will produce IDENTICAL ASSEMBLY INSTRUCTIONS: int main() { int i; char c; short s; printf("i = %p\n",&i); printf("c = %p\n",&c); printf("s = %p\n",&s); return 0; } In other words YOU ARE STILL WRONG EVEN IF WE IGNORE YOUR MOVING OF THE GOALPOSTS. Now would be a good opportunity for YOU to either ADMIT YOUR MISTAKE OR FUCK OFF. /Flibble -- "Snakes didn't evolve, instead talking snakes with legs changed into snakes." - Rick C. Hodgin "You won't burn in hell. But be nice anyway." – Ricky Gervais "I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais "Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Byrne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?" "I'd say, bone cancer in children? What's that about?" Fry replied. "How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil." "Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say." |
boltar@nowhere.co.uk: Jul 14 03:18PM On Tue, 14 Jul 2020 10:38:27 +0100 >> And here are the relevant assembly instructions. Notice anything? >And it is likely that the following code will produce IDENTICAL ASSEMBLY >INSTRUCTIONS: Yes, of course it probably will. What the fuck is your point? >} >In other words YOU ARE STILL WRONG EVEN IF WE IGNORE YOUR MOVING OF THE >GOALPOSTS. I haven't moved the goalposts pal, you've just got your fields confused. |
boltar@nowhere.co.uk: Jul 14 03:22PM On Tue, 14 Jul 2020 11:25:29 +0000 (UTC) >Your original claim was: Classes cannot be instantiated if their internal >structure is not known. I explained in detail why that's an incorrect >assertion. Its not, you're simply an idiot or a troll. Or maybe both. >But rather than admit that it was incorrect, you are now just hammering on and >on about a complete sidetrack: Whether the internal structure is stored in >the executable binary or not. Where else will it be stored, in Nieminen Magic Bytes that exist in Fantasy Finland in a mysterious part of the memory along with Digital Santa? >out on it, you *still* try to keep sidetracking. >It's useless to try to sidetrack and dodge. I can see perfectly well what >you are doing. No, you're simply accusing me of something you're doing yourself. Its a very old technique which will nail some people. Sadly for you I'm not one of them. I notice you made no comment on the assembler. Bit confusing for you was it Mr Genius? |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Jul 14 05:02PM +0100 >> In other words YOU ARE STILL WRONG EVEN IF WE IGNORE YOUR MOVING OF THE >> GOALPOSTS. > I haven't moved the goalposts pal, you've just got your fields confused. How dense are you, mate? If one piece of source code with a class produces an identical binary as another piece of source code without any classes at all then please kindly explain how it can possibly be true that class layout information is stored in the binary? Take all the time you need. /Flibble -- "Snakes didn't evolve, instead talking snakes with legs changed into snakes." - Rick C. Hodgin "You won't burn in hell. But be nice anyway." – Ricky Gervais "I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais "Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Byrne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?" "I'd say, bone cancer in children? What's that about?" Fry replied. "How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil." "Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say." |
boltar@nowhere.co.uk: Jul 16 07:49AM On Wed, 15 Jul 2020 17:01:19 +0100 >I'm beginning to wonder if I have ever met such a poor excuse for a troll; I >am also wondering if you aren't actually trolling but you really are that >stupid. "I can't understand your point even after its been explained a dozen times so you must be stupid". Yeah, that always works so well as an argument. Is that what you said to your lecturers at uni? Assuming you even went to one. |
Juha Nieminen <nospam@thanks.invalid>: Jul 16 07:17AM > This was my last post here in this newsgroup of C++ > Good bye. Haha! You are such a joker. |
Scott Newman <scott69@gmail.com>: Jul 16 09:43AM +0200 > Hello, > This was my last post here in this newsgroup of C++ Oh, no, your posts are always welcome here. At least according to most readers. |
Juha Nieminen <nospam@thanks.invalid>: Jul 12 06:14AM > Read again, i correct about Delphi and Freepascal and volatile and safety.. Are you going to keep spamming thew newsgroup by posting the same thing again and again and again, fixing some missed comma? Posting the same thing again and again is the exact definition of spamming. Why don't you go spam somewhere else? |
Scott Newman <scott69@gmail.com>: Jul 12 09:09AM +0200 Thank you for your enriching thoughts. I would like to read more of you here. |
Nikki Locke <nikki@trumphurst.com>: Jul 14 10:23PM Available C++ Libraries FAQ URL: http://www.trumphurst.com/cpplibs/ This is a searchable list of libraries and utilities (both free and commercial) available to C++ programmers. If you know of a library which is not in the list, why not fill in the form at http://www.trumphurst.com/cpplibs/cppsub.php Maintainer: Nikki Locke - if you wish to contact me, please use the form on the website. |
Lynn McGuire <lynnmcguire5@gmail.com>: Jul 14 04:40PM -0500 "Two new Keywords in C++20: consteval and constinit" http://www.modernescpp.com/index.php/c-20-consteval-and-constinit Two more keywords that I will probably never use. Lynn |
Tim Rentsch <tr.17687@z991.linuxsc.com>: Jul 14 06:11AM -0700 >> program has undefined behavior, which is determined solely by what >> is specified (or not) to happen in the abstract machine. > No. UB is not solely a static property of a program. [...] You're putting words in my mouth. Please don't do that. The C++ standard says this: in 4.1 p2.3, If a program contains a violation of a rule for which no diagnostic is required, this International Standard places no requirement on implementations with respect to that program. and in 3.29, defining the term "well-formed program", C++ program constructed according to the syntax rules, diagnosable semantic rules, and the one-definition rule With the understanding that what is being discussed is only well-formed programs that do _not_ violate 4.1 p2.3, here is a more specific phrasing of my statement above: These things [like stack usage] do not affect whether a program execution has undefined behavior, which is determined solely by what the C++ standard specifies (or not) will happen in the abstract machine, as a function of the state of the abstract machine and what source program element is under consideration, at each point in the particular execution of the program. Contents of files, and input or output to them, etc, may be taken to be part of the state of the abstract machine. The key point is that definedness is a function only of the abstract machine, and not the actual machine. The details are spelled out in section 4.6, aka intro.execution. Does this elaboration help clarify my comment? |
aminer68@gmail.com: Jul 15 05:49PM -0700 Hello, What is it to be smart ? I am a white arab, and i think i am smart like a genius :), since i have invented many scalable algorithms and there implementations, and today i will speak about what is it to be "smart".. So i will start it by inviting you to read carefully the following webpage from a Senior Consultant (and former Editor-in-Chief and Publishing Director) of New Scientist and Author of After the Ice: Why are humans smarter than other animals? https://www.edge.org/response-detail/12021 So as you are noticing he is saying the following: -- "The idea of human superiority should have died when Darwin came on the scene. Unfortunately, the full implications of what he said have been difficult to take in: there is no Great Chain of Being, no higher and no lower. All creatures have adapted effectively to their own environments in their own way. Human "smartness" is just a particular survival strategy among many others, not the top of a long ladder. It took a surprisingly long time for scientists to grasp this. For decades, comparative psychologists tried to work out the learning abilities of different species so that they could be arranged on a single scale. Animal equivalents of intelligence tests were used and people seriously asked whether fish were smarter than birds. It took the new science of ethology, created by Nobel-prize winners Konrad Lorenz, Niko Tinbergen and Karl von Frisch, to show that each species had the abilities it needed for its own lifestyle and they could not be not arranged on a universal scale. Human smartness is no smarter than anyone else's smartness. The question should have died for good." -- So i am smart like a genius and i say that there the above webpage is not so smart, because the logical reasoning defect is that he is first saying the following: "Human "smartness" is just a particular survival strategy" This is the first logical defect, since he is like using boolean logic by saying that human smartness is only a particular survival strategy, and this is not correct logical reasoning, because we have like to be fuzzy logic and say that not all humans are using smartness for only survival, since we are not like animals, since we have not to think it societally, but we can also say there is a great proportion of humans that have transcended there "survival" condition with there smartness to be a much better human condition than only survival. So now we can say with human smartness (and measure it with human smartness) that the humans that have transcended there "survival" condition with there smartness to be a much human condition have a much superior smartness than animals, since we can measure it with human smartness, and here is the definition of surviving in the dictionary: https://www.dictionary.com/browse/survive So as you are noticing that survival is only to remain alive, so i am logical in my thoughts above. The second logical defect of the above webpage is the following: Notice that the above webpage that he is saying the following: "Strangley enough, even evolutionary biologists still get caught up with the notion that humans stand at the apex of existence. There are endless books from evolutionary biologists speculating on the reasons why humans evolved such wonderful big brains, but a complete absence of those which ask if a big brains is a really useful organ to have. The evidence is far from persuasive. If you look at a wide range of organisms, those with bigger brains are generally no more successful than those with smaller brains — hey go extinct just as fast." So i think that the above webpage is not right. So notice again that he is saying that the brain must be successful in survival, and this is not correct reasoning, since as i said above smartness is not only about survival, since we have to measure it with our smartness and notice that from also my above thoughts that we can be humans that are much more smart than animals even if we go extinct. So the important thing to notice in my above logical reasoning , is that you have to measure smartness with smartness, it is the same as my following logical proof about: Is beauty universal ? , here it is , read it carefully: I will make you understand with smartness what about the following webpage: Look at the following webpage from BBC: The myth of universal beauty https://www.bbc.com/future/article/20150622-the-myth-of-universal-beauty So notice in the above webpage that it is saying the following about beauty: "Where starvation is a risk, heavier weight is more attractive" So you have to understand that the above webpage from BBC is not smart, i will make you understand with smartness that beauty is universal, so if we take the following sentence of the above webpage: "Where starvation is a risk, heavier weight is more attractive" So you have to put it in the context of the above webpage, and understand that the way of thinking of the webpage from BBC is not smart, because it is saying that since in the above sentence starvation is a risk , so heavier weight can be more attractive, but this can be heavier weight that is not beautiful for the eyes, so it makes a conclusion that universal beauty is not universal, but this is not smart because we have not to measure beautifulness with only our eyes and say that heavier weight that is not beautiful for the eyes is not beautiful, because we have to measure it with smartness and say that smartness says that in the above sentence that heavier weight that is not beautiful for the eyes is beautiful for smartness because starvation is a risk, so then with smartness we can say that beauty is universal. So we have to know that that the system of reference of measure is very important, by logical analogy we can say that measuring beautifulness with the eyes is like measuring individual smartness with only genetics, but measuring beautifulness with both the eyes and smartness is like measuring individual smartness with both the genetical and the cultural. Thank you, Amine Moulay Ramdane. |
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:
Post a Comment