- string_view problem - 3 Updates
- is there a C++ version of the strtok() function? - 5 Updates
| "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Jun 29 01:01AM +0200 On 28.06.2019 22:14, Geoff wrote: >> better referred to on GitHub. > There's another one - GCIGC: Garbage Code Is Garbage Code. > The OP would be better off ignoring your posts. I seem to remember killfiling you years ago. Anyway, plink. |
| Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Jun 29 12:16AM +0100 On 28/06/2019 08:54, Alf P. Steinbach wrote: > One of them is "DRY": Don't Repeat Yourself. > I'm not going to add more code to postings when that common code is much > better referred to on GitHub. So, Alf, how many people telling you that what you are doing is fucking egregious will it take for you to stop posting fucking egregious code? Please when posting snippets that are answers to questions: 1) DO NOT use your personal non-standard fucktarded library that flings dollar sign shit all over the walls of the room; 2) KEEP your use of auto return type deduction to the cases that require it; 3) DO NOT write auto main() ... (see (2)) as it makes you look like a trolling cunt fuckwomble who just wants to irritate everyone. /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," Bryne 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." |
| Melzzzzz <Melzzzzz@zzzzz.com>: Jun 28 11:17PM > 3) DO NOT write auto main() ... (see (2)) as it makes you look like a > trolling cunt fuckwomble who just wants to irritate everyone. > /Flibble As much as I don't like style I am always for free speach :P -- press any key to continue or any other to quit... U ničemu ja ne uživam kao u svom statusu INVALIDA -- Zli Zec Na divljem zapadu i nije bilo tako puno nasilja, upravo zato jer su svi bili naoruzani. -- Mladen Gogala |
| Keith Thompson <kst-u@mib.org>: Jun 28 03:10PM -0700 > On Friday, June 28, 2019 at 3:26:31 PM UTC-4, Alf P. Steinbach wrote: [...] > That's implementation-specific. The standard does not specify how to > enable support for annex K, only how to check whether support has been > enabled. It does both. An implementation uses __STDC_LIB_EXT1__ for the former. A program can use __STDC_WANT_LIB_EXT1__ for the latter. For details, see K.2p2 and K.3.1.1 in N1570/C11. -- Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst> Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */ |
| Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Jun 28 11:48PM +0100 On 28/06/2019 18:14, alexo wrote: > my asking is: > is there a purely C++ function that behaves like the C strtok() ? > thank you C++ includes strtok as std::strtok but why would you want to use a demented thing such as strtok in C++? Use std::regex or write your own sane tokeniser that doesn't modify the input string. /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," Bryne 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." |
| "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Jun 29 12:53AM +0200 On 28.06.2019 21:11, alexo wrote: > a C++ std function that replaces strtok. >> But the main problem with `strtok` is that it isn't thread safe. > I don't need threads, so strtok is ok. On further reflection, after looking at the documentation of `strtok`, I don't see how you could have written a parser that works for the example formula, using that function. Because it discards the delimiter it stops at. Which means, in any way I think of using it, that it discards the parentheses. In my response to you I hadn't yet looked at the `strtok` docs, I just assumed that (as I interpreted it) what you wrote about having a working parser, was correct, and then I based what I wrote on what I remembered about the function. Re the question: part of what's unclear about the requirements is e.g. the rules for use of square brackets versus round parentheses, and whether there can be multi-digit integers in there. From what I remember of chemistry and quantum mechanics I guess the maximum number would be 7 or less, maybe just 4? But guesswork doesn't make up for a clear spec. Cheers!, - Alf |
| Ben Bacarisse <ben.usenet@bsb.me.uk>: Jun 28 11:57PM +0100 alexo <alelvb@inwind.it> writes: <cut> > I get: Na Fe CN 6 > that is a correct but useless decomposition, because as you stated, I > can't match the '6' referring to both the 'Fe' and the 'CN' group. Can you link to a definition of this notation? The examples look simple but I can imagine that it could get complex and I don't want to suggest anything that is a dead-end. Even so I suspect that regexes and parser generators are all a bit heavy-weight. The tokens appear to be element names (upper-case letter optionally followed by one lower-case letter though you could limit it to just the valid ones), numbers and (, ), [, ] and *, so what would be called the lexical analysis is very simple. To know where to go from there one would need to know what the result of the parse should be. -- Ben. |
| James Kuyper <jameskuyper@alumni.caltech.edu>: Jun 28 07:09PM -0400 On 6/28/19 4:35 PM, James Kuyper wrote: >> * To use it you're apparently supposed to #define __STDC_WANT_LIB_EXT1__ >> as 1 before including any C library header. > That's implementation-specific. The standard does not specify how to enable support for annex K, only how to check whether support has been enabled. Strictly speaking, what I said was correct - #defining __STDC_WANT_LIB_EXT1__ doesn't have any effect unless the implementation pre#defines __STDC_LIB_EXT1__. However, the wording of my comment reflected the fact that I was unaware of the fact that the effects of #defining __STDC_WANT_LIB_EXT1__ are in fact specified by the C11 standard. I don't make much use of Annex K, so I hadn't delved into the details of how it works. |
| 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