Monday, March 6, 2023

Digest for comp.lang.c++@googlegroups.com - 10 updates in 4 topics

Frederick Virchanza Gotham <cauldwell.thomas@gmail.com>: Mar 06 01:41PM -0800

Actually instead I think I'm going to link the program dynamically as normal, but then after the executable file is built, use 'patchelf' on it to remove some of the 'NEEDED' libraries, so then I can just use 'dlopen' at runtime.
gazelle@shell.xmission.com (Kenny McCormack): Mar 06 10:20PM

In article <fa55ce4e-39e4-45e0-9bc0-736dacce73e5n@googlegroups.com>,
>normal, but then after the executable file is built, use 'patchelf' on it
>to remove some of the 'NEEDED' libraries, so then I can just use 'dlopen'
>at runtime.
 
You do you...
 
--
Kenny, I'll ask you to stop using quotes of mine as taglines.
 
- Rick C Hodgin -
Christian Gollwitzer <auriocus@gmx.de>: Mar 06 11:58PM +0100

Am 06.03.23 um 22:41 schrieb Frederick Virchanza Gotham:
 
> Actually instead I think I'm going to link the program dynamically as normal, but then after the executable file is built, use 'patchelf' on it to remove some of the 'NEEDED' libraries, so then I can just use 'dlopen' at runtime.
 
Who would have thought that you come up with another bizarre hack. I'm
beginning to think that you do these things for fun. I can sympathise
with this idea, hacking is fun.
 
Christian
James Kuyper <jameskuyper@alumni.caltech.edu>: Mar 06 02:31PM -0500

On 3/5/23 11:14, MarioCPPP wrote:
> also a be warranty to point to a valid object (no nullptr).
 
> But a Type && seems to be also able to point to ... to what ?
> What is for ?
 
A key point to keep in mind is that when a '&' character is parsed as a
token, it can mean the unary address-of operator, the binary bitwise-and
operator, or it could indicate a reference in a type specification. In
none of those contexts would it ever make sense to use two consecutive
'&' tokens, and it is therefore not allowed by the grammar. Instead, a
pair of consecutive '&' characters is parsed as a single "&&" token.
Depending upon the context, that token could mean either the binary
logical-and operator, or as part of type declaration, it identifies an
rvalue reference.
Andrey Tarasevich <andreytarasevich@hotmail.com>: Mar 06 02:00PM -0800

On 03/05/23 8:14 AM, MarioCPPP wrote:
> But a Type && seems to be also able to point to ... to what ?
> What is for ?
 
`&&` should be perceived as a monolithic token, not a "reference to
reference". It is just a special kind of reference known as "rvalue
reference".
 
A formal answer for what it is would be: It is special kind of reference
that is shoehorned into the C++ type system with its own initialization
and overload resolution rules. Find the specification, read these rules
and use this kind of reference whenever it works for you.
 
A more human-friendly answer might sound as follows: The whole thing was
designed with one specific purpose in mind: move semantics. You can use
rvalue references and their properties to elegantly implement move
semantics. Note that move semantics is not a core-language concept, it
is something you implement yourself, manually, by taking advantage of
rvalue references' properties. Find a book on modern C++, read about
move semantics.
 
Finally, rvalue references can be useful for other purposes, not just
for their primary purpose (i.e. move semantics), so you can feel free to
use them wherever you consider appropriate.
 
--
Best regards,
Andrey
MarioCPPP <NoliMihiFrangereMentulam@libero.it>: Mar 06 11:22PM +0100

On 06/03/23 23:00, Andrey Tarasevich wrote:
> not just for their primary purpose (i.e. move semantics), so
> you can feel free to use them wherever you consider
> appropriate.
 
now ... with the suggestions from You and others in the
thread, I am beginning to understand the very basic of what
it is (I did not know an R-value could even have a reference
... my fault !)
 
But I still cant'imagine its use.
I have to understand what is a MOVE SEMANTIC.
 
In my old-styled mind move IS copying (and deleting the
original object).
 
Others said "to avoid DEEP copying", which is a concept I
know, but still I am unable to connect with the R-value
reference concept.
 
Anyway, I will try to study further to understand if this
semantic will ever be useful to me.
Tnx to all
 
 
 
--
1) Resistere, resistere, resistere.
2) Se tutti pagano le tasse, le tasse le pagano tutti
MarioCPPP
Keith Thompson <Keith.S.Thompson+u@gmail.com>: Mar 06 10:00AM -0800


> #define END_LINE "\n"
 
> and it solved the problem.
> Thank you for help.
 
I suggest it would be clearer to drop the END_LINE macro and use "\n"
or '\n' directly.
 
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for XCOM Labs
void Void(void) { Void(); } /* The recursive call of the void */
James Kuyper <jameskuyper@alumni.caltech.edu>: Mar 06 02:30PM -0500

On 3/6/23 11:06, Jivanmukta wrote:
> ...
> failure_dirtyphp(dirtyphp.get_usage() + END_LINE + dirtyphp.get_help()
> + END_LINE);
 
If you have a stream opened in text mode, when you send a '\n' to that
stream, it automatically gets converted to what method the standard
library uses to indicate the end of a line, which usually matches the
line-ending convention on that platform. The inverse conversion gets
performed when you read from a text file. As a result, you don't need to
write different code for platforms with different ways of indicating the
end of a line. See <https://en.m.wikipedia.org/wiki/Newline> for a list
of the wide variety of different methods used to represent the end of a
line in many different contexts. In particular, to break some
preconceptions you might have, take a look the descriptions for
record-based and fixed line length systems.
 
The C++ standard says almost nothing about text mode vs binary mode,
cross-referencing the C standard library for definitions of how the C++
I/O library routines work. Here's what the C standard says about it:
 
(7.21.2p2)
> space characters that are written out immediately before a new-line
> character appear when read in
> is implementation-defined.
 
Note, in particular, the peculiar connection between new-lines and
spaces. That's intended to allow implementations which use fixed line
length systems, with end-of-line indicated by padding to the end with
blanks.
 
(7.21p3)
Jivanmukta <jivanmukta@poczta.onet.pl>: Mar 06 07:35PM +0100

W dniu 06.03.2023 o 19:00, Keith Thompson pisze:
>> Thank you for help.
 
> I suggest it would be clearer to drop the END_LINE macro and use "\n"
> or '\n' directly.
 
You are right. I used macro because I had 2 different definitions for
Linux and for Windows. Now I have identical definitions and macro is not
necessary.
 
--
Ta wiadomość e-mail została sprawdzona pod kątem wirusów przez oprogramowanie antywirusowe AVG.
www.avg.com
James Kuyper <jameskuyper@alumni.caltech.edu>: Mar 06 02:33PM -0500

On 3/2/23 15:13, Lynn McGuire wrote:
 
>> Yes, of course. And paid quite well. And for the last quarter
>> of a century, exclusively using gcc and sometimes clang or systemC.
 
> So none of these projects included Fortran ?
 
You've lost the thread of the conversation. He was comparing Fortran
with C and C++. His point was that the creation of freeware C and C++
compilers didn't mark the conversion of either of those languages to
hobbyist status, so the creation of freeware Fortran compilers shouldn't
be expected to mark the conversion of Fortran to hobbyist status either.
Particularly since freeware Fortran compilers have already been around
for a long time. A small portion of all the new code that I've seen
people develop in the last decade or so was in Fortran, and GNU Fortran
was the only compiler I've seen any of them use.
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: