Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  nodelist  faq  

Another megabytes the dust.


programming / comp.lang.c++ / latest

Sugar

comp.lang.c++

Posted: 10 Hours 9 Minutes ago by: Mr Flibble

https://twitter.com/i42Software/status/1421581244207439876

Re: "Nearly a quarter-century later, why is C++ still so popular?"

comp.lang.c++

Posted: 1 Day 19 Hours ago by: Manfred

I wouldn't rule out OOP entirely, but it is true that OOP has been overestimated in its early years. It is not only a matter of efficiency and being hardware-friendly, it is also about the fact that OOP is well suited for some classes o

Re: "Nearly a quarter-century later, why is C++ still so popular?"

comp.lang.c++

Posted: 1 Day 19 Hours ago by: Manfred

Good points, agreed.

Re: "Nearly a quarter-century later, why is C++ still so popular?"

comp.lang.c++

Posted: 1 Day 20 Hours ago by: MrSpud_7...@slwgrcbm

And where do these subcontainers allocate their memory from? The magic woo woo heap in special moonbeam memory?

Re: "Nearly a quarter-century later, why is C++ still so popular?"

comp.lang.c++

Posted: 2 Days 15 Hours ago by: Öö Tiib

When it matters to performance then there are presumably large containers of such objects? The boost::base_collection can help there as instead of allocating each object dynamically in random memory locations it keeps those in subcontaine

Re: "Nearly a quarter-century later, why is C++ still so popular?"

comp.lang.c++

Posted: 2 Days 22 Hours ago by: Chris Vine

It's not just OOP which is the problem. Move semantics are also an issue, because the purpose of moving a rvalue, instead of copying it, is to enable the internal implementation of the object to be transferred into another object. This

Re: "Nearly a quarter-century later, why is C++ still so popular?"

comp.lang.c++

Posted: 3 Days ago by: Juha Nieminen

I suppose it depends a bit on your definition of "object-oriented programming". In the most traditional sense OOP means that your program has been structured into classes and sub-classes, in other words, inheritance hierarchies, and most

Re: "Nearly a quarter-century later, why is C++ still so popular?"

comp.lang.c++

Posted: 3 Days 10 Hours ago by: Siri Cruise

My sql interface returns effectively arrays of unions. I also have no deallocation interface. I do have explicit begin/end because sql tables really need to have transactions ended or aborted in a clear and definite manner.

Re: "Nearly a quarter-century later, why is C++ still so popular?"

comp.lang.c++

Posted: 3 Days 12 Hours ago by: Alf P. Steinbach

Multi-paradigm. :) - Alf (Oh, "I like your car"! :-o )

Re: "Nearly a quarter-century later, why is C++ still so popular?"

comp.lang.c++

Posted: 3 Days 16 Hours ago by: Siri Cruise

So C++ but no OOP?

Re: "Nearly a quarter-century later, why is C++ still so popular?"

comp.lang.c++

Posted: 3 Days 17 Hours ago by: Alf P. Steinbach

Very clarifying. I agree with you. I just didn't think of it that way. - Alf

Re: "Nearly a quarter-century later, why is C++ still so popular?"

comp.lang.c++

Posted: 3 Days 22 Hours ago by: MrSpud_o...@khlkg.in

That depends who wrote it. Unfortunately a lot of C++ I see seems to be a load of syntax circle jerking with pointless features being thrown into the code that bring nothing to the table and simply obfuscate the code path simply because

Re: "Nearly a quarter-century later, why is C++ still so popular?"

comp.lang.c++

Posted: 3 Days 23 Hours ago by: Juha Nieminen

Because it is. Or, more precisely, perhaps GC *in itself* is not inefficient, but the paradigm it's solving has turned out to be. You see, garbage collection arose primarily from a practical problem in object-oriented programming, and t

Re: "Nearly a quarter-century later, why is C++ still so popular?"

comp.lang.c++

Posted: 4 Days 1 Hour ago by: Bo Persson

Here "dead like COBOL" could mean "used a lot, but after 25+ years the developers don't need to ask lots of questions on the internet". So doesn't show up on TIOBE.

Re: "Nearly a quarter-century later, why is C++ still so popular?"

comp.lang.c++

Posted: 4 Days 5 Hours ago by: Bonita Montero

Because its magnitudes more productive and maintainable than C with the same performance.

Re: "Nearly a quarter-century later, why is C++ still so popular?"

comp.lang.c++

Posted: 4 Days 7 Hours ago by: Cholo Lennon

It's not just what people think, there are a lot scenarios where garbage collection is not a problem. I worked many years in the telecom industry using C++ and Java... when the hardware got cheap and powerful, we started to move a lot

Re: "Nearly a quarter-century later, why is C++ still so popular?"

comp.lang.c++

Posted: 4 Days 10 Hours ago by: Keith Thompson

C++ has destructors. I suspect that's what Siri Cruise was referring to. Saying that garbage collection is a substitute for destructors suggests that memory is the only resource that needs to be managed.

Re: "Nearly a quarter-century later, why is C++ still so popular?"

comp.lang.c++

Posted: 4 Days 10 Hours ago by: Vir Campestris

But C++ doesn't have finalisers. That's a feature of GC languages. Did you mean C#? Andy

Re: "Nearly a quarter-century later, why is C++ still so popular?"

comp.lang.c++

Posted: 4 Days 10 Hours ago by: Siri Cruise

Because too many people still think garbage collection is inefficient, and they can do better. See also Apple's dependence on reference counting and thus the inability to do generic graph data structures. Object oriented programming

"Nearly a quarter-century later, why is C++ still so popular?"

comp.lang.c++

Posted: 4 Days 11 Hours ago by: Lynn McGuire

"Nearly a quarter-century later, why is C++ still so popular?" https://sdtimes.com/softwaredev/nearly-a-quarter-century-later-why-is-c-still-so-popular/ "Despite C++’s downward trend on the TIOBE Programming Community index since 2001

Re: good reference on threads

comp.lang.c++

Posted: 5 Days 5 Hours ago by: Bonita Montero

Google for: "c++ concurrency in action doctype:pdf" And you find the PDF of the 1st ed.

Re: good reference on threads

comp.lang.c++

Posted: 5 Days 6 Hours ago by: Richard

[Please do not mail me a copy of your followup] Lynn McGuire <lynnmcguire5@gmail.com> spake the secret code <sbm13f$a1k$1@dont-email.me> thusly: It's organized in such a way that you can dig as deep (or as shallow) as you like and still

Re: good reference on threads

comp.lang.c++

Posted: 5 Days 6 Hours ago by: Richard

[Please do not mail me a copy of your followup] Lynn McGuire <lynnmcguire5@gmail.com> spake the secret code <s9ujq0$dhn$1@dont-email.me> thusly: I have read this and it's what I was going to recommend :)

Re: A little OT. Debug a ncurses C program with eclipse [SOLVED in

comp.lang.c++

Posted: 9 Days 7 Hours ago by: Paulo da Silva

I didn't test, but may be. Neverthless, for repeated lauches, it may not be wothwhile. I'll see ... Thanks

Re: A little OT. Debug a ncurses C program with eclipse [SOLVED in

comp.lang.c++

Posted: 9 Days 13 Hours ago by: red floyd

Couldn't you run under gdb in the terminal, break at main, and then detach once you've attached Eclipse?

Re: A little OT. Debug a ncurses C program with eclipse [SOLVED in

comp.lang.c++

Posted: 9 Days 15 Hours ago by: Paulo da Silva

.... You are missing the point that the program is launched outside eclipse/gdb. So it runs ... Later we attach to it from eclipse. So, we need to force it "to wait" for us to attach to it. Besides, the eclipse issues a call to gdb using

Re: A little OT. Debug a ncurses C program with eclipse [SOLVED in

comp.lang.c++

Posted: 10 Days 6 Hours ago by: red floyd

You could put "break main" in your .gdbinit file. Then it will break at main automatically.

Re: A little OT. Debug a ncurses C program with eclipse [SOLVED in

comp.lang.c++

Posted: 10 Days 14 Hours ago by: Paulo da Silva

Ok, to fix this: Change in /etc/sysctl.d/10-ptrace.conf kernel.yama.ptrace_scope = 1 to kernel.yama.ptrace_scope = 0 Besides, one needs to put, for example, getchar(); at the beginning of the program for it to wait the debugger attach. Th

Re: A little OT. Debug a ncurses C program with eclipse

comp.lang.c++

Posted: 11 Days 20 Hours ago by: Öö Tiib

Perhaps your IDE is misconfigured. Debugger must be set up there: <https://help.eclipse.org/2021-06/index.jsp?topic=%2Forg.eclipse.cdt.debug.application.doc%2Ftasks%2Fcdt_t_run_dbg.htm>

Re: A little OT. Debug a ncurses C program with eclipse

comp.lang.c++

Posted: 12 Days 6 Hours ago by: Paulo da Silva

It failed! A popup message appears: Error in final launch sequence: Failure to attach to process: testC [56830] Error: Failed to execute MI command: -target-attach 56830 Error message from debugger back end: ptrace: Operação não pe

Re: A little OT. Debug a ncurses C program with eclipse

comp.lang.c++

Posted: 12 Days 6 Hours ago by: Paulo da Silva

How do I do that? Insert some sleep at the beginning, launch it and then use "Attach to Application" in the Debug Configurations? I'll try that, but it's weird for a thing that should be simple. Thanks

Re: A little OT. Debug a ncurses C program with eclipse

comp.lang.c++

Posted: 12 Days 6 Hours ago by: red floyd

Have you tried starting the program in a terminal, and then attaching the eclipse debugger to the PID of that process?

A little OT. Debug a ncurses C program with eclipse

comp.lang.c++

Posted: 12 Days 12 Hours ago by: Paulo da Silva

Hi! I have tried lots of ideas from Google search but still didn't get any success debugging a C program with ncurses using eclipse! I think that's mainly because the suggestions are for older eclipse versions. This should be simple. It's

Re: Wheel re-invention (Was: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 12 Days 16 Hours ago by: MrSpud_K...@wl4yrs_t

Given I already told you I wrote my own window manager (along with half a dozen games and more utilities than I can count in the last 25 years) I'm wondering why you think I need some patronising heads up on what constitutes X11 and Xli

Re: Wheel re-invention (Was: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 12 Days 16 Hours ago by: Lew Pitcher

You apparently misunderstand what I'm working with. X11 is a communications protocol, with the "client" end implemented in Xlib and the server end implemented in the X server. X11 doesn't have "textboxes", and it's "windows" are simply

Re: Wheel re-invention (Was: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 12 Days 23 Hours ago by: MrSpud_X...@nl5uzoqa

Have a look at the MacOS login screen. 2 textboxs, nothing else (for normal use), not even a window, just a background picture and a few buttons down the bottom for reboot etc.

Re: Wheel re-invention (Was: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 12 Days 23 Hours ago by: Chris M. Thomasson

[...] Humm... https://secure.login.gov/ ;^)

Re: Wheel re-invention (Was: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 12 Days 23 Hours ago by: MrSpud_2...@cligh74c

You can obviously add as many bells and whistles as you like, but ultimately all you need for a basic login system is username and password - 1 window, 2 textboxes. For the other stuff you don't need a drop down, you could just have them

Re: comp.lang.c blocked on Google Groups Switch to free (Thunderbird

comp.lang.c++

Posted: 14 Days 5 Hours ago by: steve

[ ... this is a shameless plug ... ] I have been using giganews (http://www.giganews.com) for over 10 years and have had no problems. Sometimes you need to pay for quality service. I wouldn't be surprised if google is spamming usenet

Re: Wheel re-invention (Was: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 14 Days 9 Hours ago by: Manfred

Probably Lesstif, which, as far as I remember, is a FOSS clone of Motif. But that was along time ago, so I may have missed some happening meanwhile.

Re: Wheel re-invention (Was: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 14 Days 15 Hours ago by: Lew Pitcher

Not really. To satisfy a purely local login, you need a minimum of two input edit fields: a Username that echoes typed characters and a password that doesn't. If you add XDMCP into the mix (which I intend to do), you need an additional f

Re: Wheel re-invention (Was: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 14 Days 16 Hours ago by: MrSpud_C...@atc_rakx

I should imagine most display managers are little more than a window that accepts password credentials which does credential checking and if ok simply exec's the required WM or enviroment. Personally I'd go for Motif if you can still fi

Re: comp.lang.c blocked on Google Groups Switch to free

comp.lang.c++

Posted: 15 Days 14 Hours ago by: Anton Shepelev

Regarding the reinvention of the wheel, I see nothing bad in it as it helps you understand the wheel better than *any- body* who have never (re)invented one, and perhaps even to improve upon the original. Since there are so many

Re: Wheel re-invention (Was: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 15 Days 16 Hours ago by: Lew Pitcher

Sorry, but I must make a correction here: I have no interest (at this time) in writing a Window Manager (WM) client for X11. The O'Reilly X11 Xlib book discusses WMs in detail, and includes the code for a rudementary WM implemented in Xl

Re: Wheel re-invention (Was: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 15 Days 20 Hours ago by: Christian Gollwitzer

Oh he's quite busy to tell the people over at the Python group that their language is a bag of shite and slow as hell and that everything will change once he finished the frontend for his fancy compiler. Needless to say that there isn'

Re: Wheel re-invention (Was: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 15 Days 22 Hours ago by: MrSpud_8...@ko9uz7rn

It depends how much you want your WM to do. I did it in pure Xlib and implemented button and menu widgets (thats all thats really needed) from scratch which frankly isn't too hard. But sure, if you want a WM thats actually useful you'll

Re: Wheel re-invention (Was: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 16 Days 16 Hours ago by: Lew Pitcher

Thanks for the best wishes. Yah, I'm about 50 pages into the Xlib manual, and have completed (and played with) the basicwin example. And then, I left the manual alone, except for the reference information. I quickly found that Xlib alo

Re: Wheel re-invention (Was: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 16 Days 16 Hours ago by: MrSpud_6...@1h0c.net

The source of another window manager would be a lot more useful IMO as looking at the source of the above won't show you how to use the required APIs without doing some reverse engineering nor will it show you what to use when.

Re: Wheel re-invention (Was: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 16 Days 17 Hours ago by: Scott Lurndal

Hm.. All the X11Rx code is open source; it's easy enough to use the source of libX11, libXt, and libXaw as a reference.

Re: Wheel re-invention (Was: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 16 Days 23 Hours ago by: MrSpud_0...@uncf5cot

Good luck with that (genuinely, I'm not being sarcastic). I wrote one about 20 years ago and it was a fun project to do but the problem was that even the venerable O'Reilly XLib manuals didn't provide all the information required as they'

Re: Wheel re-invention (Was: comp.lang.c blocked on Google Groups Switch to free (Thunderbird)

comp.lang.c++

Posted: 16 Days 23 Hours ago by: MrSpud_...@em8kceu_4

The irony of mentioning Linux there. But you probably won't get it :) It doesn't do everything I need. Given writing software to get and post articles on usenet isn't exactly arduous (providing you understand networking) and that it was

Re: Trying to understand pointers. Why does this give unexpected

comp.lang.c++

Posted: 16 Days 23 Hours ago by: Fred. Zwarts

Doesn't that print the address of ptrC, instead of the address of c?

Available C++ Libraries FAQ

comp.lang.c++

Posted: 17 Days 9 Hours ago by: Nikki Locke

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

Re: Wheel re-invention (Was: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 17 Days 10 Hours ago by: Kenny McCormack

I'd be interested to know more about that (as a cyclist myself). Also, this whole sub-thread about re-inventing trn, makes me think of a certain frequent poster who is always going on about how he's gonna re-invent everything. Haven't h

Re: Wheel re-invention (Was: comp.lang.c blocked on Google Groups Switch to free (Thunderbird)

comp.lang.c++

Posted: 17 Days 11 Hours ago by: Eli the Bearded

I get the impression from news.software.readers that when people post about creating new newsreaders these days the are looking for features you don't get in tin/trn. Things like working well with multiple news servers (track reading by m

Re: Wheel re-invention (Was: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 17 Days 11 Hours ago by: Kaz Kylheku

Someone is reinventing the literal wheel right now in the world of high end bicycles, though.

Re: Wheel re-invention (Was: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 17 Days 11 Hours ago by: Lew Pitcher

I can think of many possible reasons to (re)create an existing tool: - the existing tools do not provide the functionality you require, or - the existing tools do not provide the usability you require, or - you wish to incorporate the to

Re: Wheel re-invention (Was: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 17 Days 12 Hours ago by: Manfred

Don't forget how cool is the wheel :)

Wheel re-invention (Was: comp.lang.c blocked on Google Groups Switch to free (Thunderbird)

comp.lang.c++

Posted: 17 Days 12 Hours ago by: Kenny McCormack

There's no need to. Really, talk about wheel re-invention. Hey, here's an idea, why not write a new OS? Who needs Linux? Who need z/OS? (etc) trn (and similar, such as "tin") does everything you need, so why not use it? You'd spend

Re: comp.lang.c blocked on Google Groups Switch to free (Thunderbird

comp.lang.c++

Posted: 17 Days 15 Hours ago by: MrSpud...@rm5.biz

Maybe some people have, but I get the impression most haven't.

Re: comp.lang.c blocked on Google Groups Switch to free (Thunderbird

comp.lang.c++

Posted: 17 Days 16 Hours ago by: Scott Lurndal

What makes you think we haven't?

Re: comp.lang.c blocked on Google Groups Switch to free (Thunderbird

comp.lang.c++

Posted: 18 Days ago by: MrSpud_0...@1luxp5mj

Given how many apparent geniuses subscribe to comp.lang.c++ I'm amazed none of them have written their own newsreader. NNTP is quite a simple protocol after all. I did and I'm using it now. Ok, its command line, not GUI but it does the jo

Re: comp.lang.c blocked on Google Groups Switch to free (Thunderbird and eternal-september)

comp.lang.c++

Posted: 18 Days 13 Hours ago by: Scott Lurndal

Nope. See headers. Mine will save cancelled posts to ~/dead.letter however.

Re: comp.lang.c blocked on Google Groups Switch to free (Thunderbird

comp.lang.c++

Posted: 18 Days 14 Hours ago by: Real Troll

Surely, all news client must have a facility to save messages somewhere when the user sends something. Even in the 90s when Netscape and Outlook Express were two GUI news clients had a facility to save messages in sent folder. Now in

Re: comp.lang.c blocked on Google Groups Switch to free (Thunderbird

comp.lang.c++

Posted: 19 Days 2 Hours ago by: Kenny McCormack

Yeah, but... That works reasonably well, provided you are talking about the world, post, say, about 2010, and that you are, in fact, using a Windows GUI newsclient thingie, like, say, Thunderbird. But, remember, the poster in question s

Re: [ OT ] C - Open Standards

comp.lang.c++

Posted: 21 Days 8 Hours ago by: Cholo Lennon

I always return to this page when I need a reference/link to some particular C/C++ standard document: https://stackoverflow.com/questions/81656/where-do-i-find-the-current-c-or-c-standard-documents -- Cholo Lennon Bs.As. ARG

Re: [ OT ] C - Open Standards

comp.lang.c++

Posted: 23 Days 4 Hours ago by: Real Troll

It looks like the University link has got a copy that is not password protected: <https://teaching.csse.uwa.edu.au/units/CITS2002/resources/n2176.pdf> I will try keep updating this list so that we have up to date copies when ever pos

Re: How to write wide char string literals?

comp.lang.c++

Posted: 23 Days 11 Hours ago by: James Kuyper

You said "It gets the wrong characters in the wide string literal, period.", and other parts of the discussion implicated source encoding assumptions as the reason why. The use of "period" implies no exceptions, and there's a very large s

Re: [ OT ] C - Open Standards

comp.lang.c++

Posted: 23 Days 21 Hours ago by: Bo Persson

I am not a lawyer :-), but these papers are not official ISO documents, so no commercial license. Especially humorous is n1256. ISO official documents are the C99 official standard, plus three separate corrigenda - TC1, TC2, and TC3.

Re: How to write wide char string literals?

comp.lang.c++

Posted: 23 Days 21 Hours ago by: James Kuyper

Paavo Helde's solution of using "\xC2\xA9" was correct for narrow string literals (on systems with CHAR_BIT==8, a requirement that he didn't bother mentioning). He was relying upon a UTF-8 => UTF-16 conversion routine of his own creation

Re: [ OT ] C - Open Standards

comp.lang.c++

Posted: 23 Days 23 Hours ago by: Philipp Klaus Krause

I understand that the WG14 / ISO copyright situation can be somewhat complicated (and in the past ISO expressed some dislike about the existance of that WG14 website). On the other hand, what you write would hold for any text, website, et

Re: [ OT ] C - Open Standards

comp.lang.c++

Posted: 23 Days 23 Hours ago by: Juha Nieminen

Note that something being directly available for download, even if it's hosted at the IP owners' own servers, doesn't make it somehow automatically legal to download if the documents are under a commercial license. Making something availa

Re: Trying to understand pointers. Why does this give unexpected results?

comp.lang.c++

Posted: 23 Days 23 Hours ago by: Juha Nieminen

I'm genuinely wondering why you are writing it like that, instead of the simpler: int *ptrA = &a; float *ptrB = &b; char *ptrC = &c; A char* pointer is overloaded to print the string pointed to by that pointer, so that will sever

Re: How to write wide char string literals?

comp.lang.c++

Posted: 23 Days 23 Hours ago by: Juha Nieminen

Clearly you have never written unit tests.

Re: How to write wide char string literals?

comp.lang.c++

Posted: 23 Days 23 Hours ago by: Juha Nieminen

No, I didn't. I wanted a way to specify wide string literals, and that solution was incorrect.

Re: [ OT ] C - Open Standards

comp.lang.c++

Posted: 24 Days ago by: David Brown

That's a useful list - thanks. As usual, Microsoft has a somewhat different definition from other people... "Open standard" usually means that the standard is /available/ to anyone who wants it - but not necessarily for free. There ar

Re: [ OT ] C - Open Standards

comp.lang.c++

Posted: 24 Days 5 Hours ago by: Real Troll

OK Thanks for informing about N1570. I have found the official download link so the complete list is as follows: <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2310.pdf> <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf> <ht

Re: [ OT ] C - Open Standards

comp.lang.c++

Posted: 24 Days 5 Hours ago by: Alf P. Steinbach

N1256 (in your list) is the amalgamated C99 + TC1 + TC2 + TC3 document, very nice. I believe N1570 (not in your list) was the last draft of C11. - Alf

Re: [ OT ] C - Open Standards

comp.lang.c++

Posted: 24 Days 7 Hours ago by: Real Troll

[ OT ] C - Open Standards

comp.lang.c++

Posted: 24 Days 7 Hours ago by: Real Troll

<http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1336.pdf> <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf> <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf> I am not sure if there are any official standards after n

Re: [ #include ] What's the difference?

comp.lang.c++

Posted: 25 Days 2 Hours ago by: Andrey Tarasevich

This is just another way of saying that every C++ question can be answered by a copy-paste of a link to the language standard. True, but not very useful. Linking to a specific section does not change much from qualitative point of view

Re: [ #include ] What's the difference?

comp.lang.c++

Posted: 25 Days 6 Hours ago by: James Kuyper

That doesn't make the question "meaningless", nor does it prevent the question from having an answer. The question can be answered in full by quoting what the standard says about std::stack<T, Container>::push() and emplace(). The ways in

Re: comp.lang.c blocked on Google Groups Switch to free (Thunderbird

comp.lang.c++

Posted: 25 Days 11 Hours ago by: Real Troll

You don't need anything elaborate. When you post anything to the newsgroups, a copy also goes into the Sent folder by default. You can configure how this handled instead of everything saved to Sent folder but it is a different topic f

Re: [ #include ] What's the difference?

comp.lang.c++

Posted: 25 Days 11 Hours ago by: Andrey Tarasevich

I need to know what `T` is. I need to know whether `myStack` holds `int`s, or `myStack` holds something else, perhaps some non-trivial, unrelated, possibly "heavy" type, which just happens to be implicitly convertible from `int`. For

Re: comp.lang.c blocked on Google Groups Switch to free (Thunderbird

comp.lang.c++

Posted: 25 Days 12 Hours ago by: James Kuyper

.... I've been participating in Usenet newsgroups since the early 90's, and I've tried save copies of all of my posts. Sometimes I forgot, and sometimes I lost saved archives, but I still have 10's of thousands of messages saved. At one t

Re: comp.lang.c blocked on Google Groups Switch to free (Thunderbird

comp.lang.c++

Posted: 26 Days 1 Hour ago by: David Brown

In particular, there is a vast difference between "deleted" and "made temporarily inaccessible". Google disabled access to c.l.c and various other groups via their groups interface. This was, as we all know, a completely idiotic "throw

Re: comp.lang.c blocked on Google Groups Switch to free (Thunderbird

comp.lang.c++

Posted: 26 Days 8 Hours ago by: Chris M. Thomasson

I need to check one of my links... Can you get it to work? https://groups.google.com/g/comp.lang.c/c/a53VxN8cwkY/m/XKl1-0a8DAAJ This must mean that comp.lang.c is back up online wrt GG! Nice!

Re: comp.lang.c blocked on Google Groups Switch to free (Thunderbird

comp.lang.c++

Posted: 26 Days 9 Hours ago by: Chris M. Thomasson

That link works, and goes to content! Thanks Keith.

Re: comp.lang.c blocked on Google Groups Switch to free (Thunderbird and eternal-september)

comp.lang.c++

Posted: 26 Days 10 Hours ago by: Keith Thompson

Re: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 26 Days 11 Hours ago by: Chris M. Thomasson

GG was nice to be able to provide a link that anybody could go to and read content, even if they never heard about usenet before. Now, all of those links are dead in the water! That sucks. Grrrr. ;^(

Re: comp.lang.c blocked on Google Groups Switch to free (Thunderbird

comp.lang.c++

Posted: 26 Days 14 Hours ago by: olcott

I provided an email address that I never use.

Re: comp.lang.c blocked on Google Groups Switch to free (Thunderbird

comp.lang.c++

Posted: 26 Days 14 Hours ago by: Real Troll

If you don't want to give your personal details to that chap running that crap then you can use aioe: <news://news.aioe.org/comp.lang.c> <news://news.aioe.org/comp.lang.c++> <http://news.aioe.org/> You don't need to give any valid e

Re: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 26 Days 14 Hours ago by: olcott

This archive seems to have full text from the earliest years of USENET. https://www.usenetarchives.com/ comp.lang.c goes back to 1986 https://www.usenetarchives.com/threads.php?id=comp.lang.c&y=0&r=0&p=1 comp.lang.java goes back to 1995

Re: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 26 Days 14 Hours ago by: Sam

--=_monster.email-scan.com-39691-1625503952-0001 Content-Type: text/plain; format=flowed; delsp=yes; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 7bit James Harris writes: There are nntp clients for Android. I

Re: comp.lang.c blocked on Google Groups Switch to free (Thunderbird and eternal-september)

comp.lang.c++

Posted: 26 Days 14 Hours ago by: olcott

The archive is distributed many places. Personally I use Giganews and their archive goes back to 2004: $4.99 per month. All of my very old messages still show up in Google groups. https://cacm.acm.org/news/248041-21-million-of-the-old

Re: comp.lang.c blocked on Google Groups Switch to free (Thunderbird

comp.lang.c++

Posted: 26 Days 14 Hours ago by: Alf P. Steinbach

As I recall Google has deleted the GG comp.lang.c archives. Half a year ago? A year? And ditto for comp.lang.java? Not sure. At the time, in a Facebook posting I compared that to the Nazi's book burning. For, it's about the same idea:

Re: comp.lang.c blocked on Google Groups

comp.lang.c++

Posted: 26 Days 16 Hours ago by: James Harris

I use Thunderbird and Eternal September when I'm at home. But an internet service like Google Groups is useful for when travelling.

Re: comp.lang.c blocked on Google Groups Switch to free (Thunderbird

comp.lang.c++

Posted: 26 Days 18 Hours ago by: olcott

Switch to free (Thunderbird and eternal-september) Free newsgroup host https://www.eternal-september.org/ Free newsgroup client https://www.thunderbird.net/en-US/

Re: dynamic_cast

comp.lang.c++

Posted: 28 Days 2 Hours ago by: Bonita Montero

It wasn't my idea to handle animal-specific behaviour outside the specific animal class. But if you do it what I suggested is the most efficient way.

Re: Trying to understand pointers. Why does this give unexpected

comp.lang.c++

Posted: 28 Days 9 Hours ago by: Real Troll

You could also do something like this:

Re: Trying to understand pointers. Why does this give unexpected results?

comp.lang.c++

Posted: 28 Days 9 Hours ago by: rob

Thanks, that helps me.

Re: How to write wide char string literals?

comp.lang.c++

Posted: 28 Days 9 Hours ago by: James Kuyper

That sequence specifies a character with a value of 0xC2 followed by a character with a value of 0xA9. When the characters in question are wider than 8 bits, that is NOT the UTF-8 encoding of the character you want. Which just means you n

Re: Trying to understand pointers. Why does this give unexpected results?

comp.lang.c++

Posted: 28 Days 11 Hours ago by: Ben Bacarisse

And you need ()s there and at least a "using namespace std;" unless you are using a museum version of C++. What would you like this code to do: char *string = "Hello world\n"; cout << string; ? Can you see the problem now? Y

Trying to understand pointers. Why does this give unexpected results?

comp.lang.c++

Posted: 28 Days 11 Hours ago by: rob

This is my test program #include everything relevant here int main { int a = 0; float b = 1.0; char c = 'c'; int *ptrA; float *ptrB; char *ptrC; ptrA = &a; ptrB = &b; ptrC = &c; cout << "value of a: " << a << "; addr

Re: dynamic_cast

comp.lang.c++

Posted: 28 Days 12 Hours ago by: Mr Flibble

You are both wrong; if you are using dynamic_casts or isDog() then that suggests you animal abstraction isn't elaborate enough, animal class should include a list of behaviours as child objects (i.e. composition instead of inheritance) a

Re: Could H correctly decide that P never halts?

comp.lang.c++

Posted: 28 Days 13 Hours ago by: olcott

The Goldbach conjecture is not undecidable in the conventional sense in that we know that both {Yes and No} are the wrong answer. The Goldbach conjecture is undecided and not undecidable.

Re: How to write wide char string literals?

comp.lang.c++

Posted: 28 Days 13 Hours ago by: Richard Damon

Add the solution for the readability is to just write the code as native literals, but NOT as the actual C++ file, and have a filter stage that translates this file into the actual C++ code with the escapes. The language was designed for

Re: dynamic_cast

comp.lang.c++

Posted: 28 Days 13 Hours ago by: Richard Damon

And why add a function like that when you could just use typeid(). You still need the table to handle types that might be sub-classed. dynamic_cast provides all that capability as built in functionality.

Re: Could H correctly decide that P never halts?

comp.lang.c++

Posted: 28 Days 13 Hours ago by: Siri Cruise

Number theory conjectures can be written as Turing Machines to produce a counterexample that halt on a counterexample or do not halt if the conjecture is true. Assume the halting problem is decidable, then the conjecture can be decide

Re: dynamic_cast

comp.lang.c++

Posted: 28 Days 13 Hours ago by: Richard Damon

Doesn't handle the Animal -> Mammel -> Canine -> Dog -> Poodle case without a big lookup table to say that Poodles are also Dogs and Canines, and Mammels. You STILL need to edit the Animal.h file every time you add new derived class. Lac

Re: Could H correctly decide that P never halts?

comp.lang.c++

Posted: 28 Days 14 Hours ago by: Bonita Montero

You don't don't discuss any C/C++-specific issues. comp.theory is the only NG that fits. Stop posting in comp.lang.c/c++. You're a off-topic-terrorist.

Re: Could H correctly decide that P never halts?

comp.lang.c++

Posted: 28 Days 14 Hours ago by: olcott

It is a specific software engineering problem in the C programming language. The C source code is provided.

Re: Could H correctly decide that P never halts?

comp.lang.c++

Posted: 28 Days 14 Hours ago by: Bonita Montero

It's related to programming in general. So you shouldn't post in groups related to specific languages.

Re: How to write wide char string literals?

comp.lang.c++

Posted: 28 Days 14 Hours ago by: Juha Nieminen

It's quite relevant. For example, if you are writing unit tests for some library dealing with wide strings (or UTF-16 strings), it's quite common to write string literals in your tests, so you need to be aware of this problem: What will w

Re: How to write wide char string literals?

comp.lang.c++

Posted: 28 Days 14 Hours ago by: Juha Nieminen

The problem is that the "\xC2\xA9" was presented as a solution to the compiler wrongly assuming some source file encoding other than UTF-8. Those two bytes are the UTF-8 encoding of a non-ascii character. In other words, it's explicitly

Re: Could H correctly decide that P never halts?

comp.lang.c++

Posted: 28 Days 14 Hours ago by: olcott

It is 100% totally related to software engineering in C. The first 8 pages of my paper are only about software engineering in C. Halting problem undecidability and infinitely nested simulation https://www.researchgate.net/publication/35

Re: Could H correctly decide that P never halts?

comp.lang.c++

Posted: 28 Days 15 Hours ago by: Bonita Montero

You are off-topic in comp.lang.c/c++. Nothing what you say is especially related to C or C++. Stop posting here.

Re: Could H correctly decide that P never halts?

comp.lang.c++

Posted: 28 Days 15 Hours ago by: olcott

void P(u32 x) { u32 Input_Halts = H(x, x); if (Input_Halts) HERE: goto HERE; } int main() { u32 Input_Halts = H((u32)P, (u32)P); Output("Input_Halts = ", Input_Halts); } When the called is calling H in infinitely nested

Re: dynamic_cast

comp.lang.c++

Posted: 28 Days 15 Hours ago by: Bonita Montero

Use an enum and return an enum-value in _one_ function. That's faster than a dynamical downcast.

Re: How to write wide char string literals?

comp.lang.c++

Posted: 28 Days 15 Hours ago by: Richard Damon

It puts into the string exactly the characters that you specified, the character of value 0x00C2 and then the character of value 0x00A9. THAT is what it says to do. If you meant the \x to mean this is a UTF-8 encode string, why are you ex

Re: dynamic_cast

comp.lang.c++

Posted: 28 Days 15 Hours ago by: Richard Damon

Wrong, the NUMBER of functions needed grows way to fast to be scalable. It also requires GLOBAL changes in API to implement local algorithms. The act of adding the function could well require recompiling millions of lines of code over ma

Could H correctly decide that P never halts?

comp.lang.c++

Posted: 28 Days 16 Hours ago by: olcott

*Halting problem undecidability and infinitely nested simulation* When the halt decider bases its halt status decision simulating its input then the conventional halting problem proof undecidability counter-example templates can be correc

Re: dynamic_cast

comp.lang.c++

Posted: 28 Days 16 Hours ago by: Bonita Montero

Virtual function calls are more scalable. Maybe, but that's much faster. Dynamic downcasts are slower. No, it is encapsulation.

Re: How to write wide char string literals?

comp.lang.c++

Posted: 28 Days 17 Hours ago by: Alf P. Steinbach

[snippety] As far as I know nobody's argued that the source encoding assumption would prevent any escapes from working. If I understand you correctly your “this sub-thread” about escapes and universal character designators -- let

Re: dynamic_cast

comp.lang.c++

Posted: 28 Days 17 Hours ago by: Richard Damon

Wrong. Application level logic should stay in the application level code. That is the only scalable option. But then it also needs isCat, isHorse, isSnake, isMammel, isReptile, and so on. The virtual function method says that you need

Re: dynamic_cast

comp.lang.c++

Posted: 28 Days 17 Hours ago by: Bonita Montero

If you're doing a dynamic_cast you're switching upon the type of the class. This switching should be better done inside the class with class -dependent code - with a virtual function call. the isDog-function would be faster.

Re: dynamic_cast

comp.lang.c++

Posted: 28 Days 17 Hours ago by: Richard Damon

Incorrect, often to add the virtual function call to get around the need for the dynamic_cast requires injecting into a class concepts that it should not be dealing with. As an example, say you have a collection of animals, and you want

Re: How to write wide char string literals?

comp.lang.c++

Posted: 28 Days 18 Hours ago by: Chris Vine

[snip] For encodings other than the 96 charcters of the basic source character set (which map onto ASCII) that the C++ standard requires, this is implementation defined and the compiler should document it. In the case of gcc, it document

Re: How to write wide char string literals?

comp.lang.c++

Posted: 28 Days 18 Hours ago by: James Kuyper

Every comment I made on this sub-thread was prefaced on the absence of any actual members of the extended character set - I was talking only about the feasibility of using escape sequences to specify such members. .... So, that shouldn'

Re: dynamic_cast

comp.lang.c++

Posted: 28 Days 18 Hours ago by: Bonita Montero

Using dynamic_cast instead of a virtual function call is bad coding.

Re: How to write wide char string literals?

comp.lang.c++

Posted: 28 Days 18 Hours ago by: James Kuyper

.... The comment that led to this sub-thread was specifically about the usability of escape sequences to specify members of the extended character set, and that's the only thing I was talking about. While that string does contain such mem

Re: How to write wide char string literals?

comp.lang.c++

Posted: 28 Days 20 Hours ago by: Alf P. Steinbach

Having a handy simple way to guarantee a correct source code encoding assumption doesn't seem irrelevant to me. On the contrary it's directly a solution to the OP's problem, which to me appears to be maximally relevant. No, Juha is

Re: How to write wide char string literals?

comp.lang.c++

Posted: 29 Days ago by: Juha Nieminen

Because the source file will most often be a text file using 8-bit characters and, in these situations most likely (although not assuredly) using UTF-8 encoding for non-ascii characters. However, when you write: const char16_t *str

Re: How to write wide char string literals?

comp.lang.c++

Posted: 29 Days 2 Hours ago by: James Kuyper

I now have a much better idea what the misunderstanding is. See below. The encoding of the basic execution character set is irrelevant if the string literals are prefixed with u8, u, or U, and use only valid escape sequences to specify m

Re: How to write wide char string literals?

comp.lang.c++

Posted: 29 Days 6 Hours ago by: Alf P. Steinbach

Juha is concerned about the compiler assuming some other source code encoding than the actual one. The implementation defined encoding of `wchar_t`, where in practice the possibilities as of 2021 are either UTF-16 or UTF-32, doesn't ma

Re: How to write wide char string literals?

comp.lang.c++

Posted: 29 Days 11 Hours ago by: James Kuyper

No, because the original post used wchar_t and the L prefix, for which the relevant encoding is implementation-defined. That's not the case for char and the u8 prefix, char16_t and the u prefix, or for char32_t and the U prefix. I have a

Re: How to write wide char string literals?

comp.lang.c++

Posted: 29 Days 17 Hours ago by: Paavo Helde

The file contains bytes, it's up to the reading code how to interpret the bytes. It can interpret the bytes as uint16_t, i.e. cast the file buffer as 'const uint16_t*' and read the first 2-byte value. If it is 0xFEFF, then it knows thi

Re: How to write wide char string literals?

comp.lang.c++

Posted: 29 Days 17 Hours ago by: Alf P. Steinbach

I agree, but unfortunately both the C and C++ standards require `wchar_t` to be able represent all code points in the largest supported extended character set, and while that requirement worked nicely with original Unicode, already in

Re: How to write wide char string literals?

comp.lang.c++

Posted: 29 Days 18 Hours ago by: Alf P. Steinbach

The BOM is a Unicode code point, U+FEFF as Paavo mentioned, originally standing for an invisible zero-width hard space. It's encoded with either little endian UTF-16 (then as two bytes), or as big endian UTF-16 (then as two bytes), or

Re: How to write wide char string literals?

comp.lang.c++

Posted: 29 Days 18 Hours ago by: MrSpud_z...@nx8574z6

No, not a troll. So its just 2 bytes in sequence, not a 16 bit value?

Re: How to write wide char string literals?

comp.lang.c++

Posted: 29 Days 19 Hours ago by: Juha Nieminen

But doesn't that have the exact same problem as in my original post? In other words, in code like this: const char16_t *str = u"something"; the stuff between the quotation marks in the source code will use whatever encoding (ostensi

Re: How to write wide char string literals?

comp.lang.c++

Posted: 29 Days 20 Hours ago by: Paavo Helde

This is probably a troll question, but answering anyway: the BOM marker U+FEFF is in the correct byte order, in both little-endian and big-endian UTF-16. That's how you tell them apart. The trick is in that the reverse value U+FFFE is

Re: How to write wide char string literals?

comp.lang.c++

Posted: 29 Days 21 Hours ago by: MrSpud_o...@92wvlb1h

Just out of interest, what byte order is the BOM in? Catch 22?

Re: How to write wide char string literals?

comp.lang.c++

Posted: 29 Days 22 Hours ago by: Keith Thompson

[...] On my system, gcc doesn't handle UTF-16 at all, with or without a BOM. (I don't know whether there's a way to configure it to do so.) It does handle UTF-8 with or without a BOM. $ file b.cpp b.cpp: C source, UTF-8 Unicode (with BO

Re: How to write wide char string literals?

comp.lang.c++

Posted: 29 Days 23 Hours ago by: Kli-Kla-Klawitter

No, the oldest gcc-version is v0.9 from March 22, 1987.

145 recent articles found.

rocksolid light 0.7.0
clearneti2ptor