Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #88064 > unrolled thread

sizeof()

Started by"gdo...@gmail.com" <gdotone@gmail.com>
First post2022-12-19 09:12 -0800
Last post2022-12-20 01:36 -0800
Articles 5 — 5 participants

Back to article view | Back to comp.lang.c++


Contents

  sizeof() "gdo...@gmail.com" <gdotone@gmail.com> - 2022-12-19 09:12 -0800
    Re: sizeof() Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-12-19 10:02 -0800
    Re: sizeof() Juha Nieminen <nospam@thanks.invalid> - 2022-12-19 18:13 +0000
    Re: sizeof() Tony Oliver <guinness.tony@gmail.com> - 2022-12-19 16:35 -0800
    Re: sizeof() Γ–ΓΆ Tiib <ootiib@hot.ee> - 2022-12-20 01:36 -0800

#88064 — sizeof()

From"gdo...@gmail.com" <gdotone@gmail.com>
Date2022-12-19 09:12 -0800
Subjectsizeof()
Message-ID<fef9de52-9919-4d1d-9b5f-aa67f6c40c03n@googlegroups.com>
should be consider a function not an operator?
I'm thinking the trend to lambda functions, or no named function makes it ok to call it a function? but ok it's an operator. looks like a function, πŸ˜‚πŸ€£πŸ˜Ž
<=> is cute, spaceship. lol. looks like upper and lower teeth to me and the corners of a mouth. I guess I would have called it grin.
lol, way too many versions of integers, but I get why there are, but still, way too many versions going forward. but fine. there should be a reason C++/ C programmers make the big bucks. πŸ€”πŸ™‚

hey and if we are going to have revisions how about adding yes and no, we now have true and false. 

  if ( isThisACharacter( c ) )... seem to me one would yes this is a character as opposed to true this is a character. oh well :
good grief.

if (  (isThisACharacter( c ) ) == yes ) { }
lol. 

and how about ending the idea that any other value then 0 will make something true.  with the addition of bool let's be strict. lol you talk about breaking some code. hey hey we need the jobs anyway. lol

we may as well dump static arrays all together.  
#define is gone and I kinda liked it. well soon to be gone. πŸ€·β€β™‚οΈ
#define yes  1
#define no    0

const int yes = 1;
const int no  = 0;
--- or ---
const bool yes = true;
const bool no  = false;

oh my! yes I guess one just needs to think. lol, lol

I'm reading a book on C++ and the author I think has gone a bit over board with 'declare a variable right before you need it'. to me it makes the code feel hacked. like, I'm programming while I type, so oh yeah I need this so let me stick it in. plus it, to me, makes the code harder to read. hard to get the overall thought cause he keeps pulling rabbits, variables, out of his hat, so to write. πŸ€¦β€β™‚οΈπŸ™ƒ  memory is plentiful and cheap, relatively speaking.

πŸ˜‡

[toc] | [next] | [standalone]


#88065

FromKeith Thompson <Keith.S.Thompson+u@gmail.com>
Date2022-12-19 10:02 -0800
Message-ID<87mt7js23y.fsf@nosuchdomain.example.com>
In reply to#88064
"gdo...@gmail.com" <gdotone@gmail.com> writes:
> should be consider a function not an operator?
[...]

No, sizeof is an operator.  A function cannot take a type as an
argument, nor can it fail to evaluate its argument(s).

The sizeof operator seems odd because its symbol is a keyword rather
than a punctuation symbol.

-- 
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 */

[toc] | [prev] | [next] | [standalone]


#88068

FromJuha Nieminen <nospam@thanks.invalid>
Date2022-12-19 18:13 +0000
Message-ID<tnq9jf$daq$1@gioia.aioe.org>
In reply to#88064
gdo...@gmail.com <gdotone@gmail.com> wrote:
> should be consider a function not an operator?

It's no more a function than eg. 'return' is. It doesn't even
require parentheses (at least for expressions).

In C++11 it could theoretically be a function, but not prior to that,
nor in C, because it needs to be evaluated at compile time.

[toc] | [prev] | [next] | [standalone]


#88083

FromTony Oliver <guinness.tony@gmail.com>
Date2022-12-19 16:35 -0800
Message-ID<7993e303-246f-461d-b92e-4f9932b16547n@googlegroups.com>
In reply to#88064
On Monday, 19 December 2022 at 17:12:37 UTC, gdo...@gmail.com wrote:
> should be consider a function not an operator? 
> I'm thinking the trend to lambda functions, or no named function makes it ok to call it a function? but ok it's an operator. looks like a function, πŸ˜‚πŸ€£πŸ˜Ž 
> <=> is cute, spaceship. lol. looks like upper and lower teeth to me and the corners of a mouth. I guess I would have called it grin. 
> lol, way too many versions of integers, but I get why there are, but still, way too many versions going forward. but fine. there should be a reason C++/ C programmers make the big bucks. πŸ€”πŸ™‚ 
> 
> hey and if we are going to have revisions how about adding yes and no, we now have true and false. 
> 
> if ( isThisACharacter( c ) )... seem to me one would yes this is a character as opposed to true this is a character. oh well : 
> good grief. 
> 
> if ( (isThisACharacter( c ) ) == yes ) { } 
> lol. 
> 
> and how about ending the idea that any other value then 0 will make something true. with the addition of bool let's be strict. lol you talk about breaking some code. hey hey we need the jobs anyway. lol 
> 
> we may as well dump static arrays all together. 
> #define is gone and I kinda liked it. well soon to be gone. πŸ€·β€β™‚οΈ 
> #define yes 1 
> #define no 0 
> 
> const int yes = 1; 
> const int no = 0; 
> --- or --- 
> const bool yes = true; 
> const bool no = false; 
> 
> oh my! yes I guess one just needs to think. lol, lol 
> 
> I'm reading a book on C++ and the author I think has gone a bit over board with 'declare a variable right before you need it'. to me it makes the code feel hacked. like, I'm programming while I type, so oh yeah I need this so let me stick it in. plus it, to me, makes the code harder to read. hard to get the overall thought cause he keeps pulling rabbits, variables, out of his hat, so to write. πŸ€¦β€β™‚οΈπŸ™ƒ memory is plentiful and cheap, relatively speaking. 
> 
> πŸ˜‡

You are fir and I claim my Β£5.

[toc] | [prev] | [next] | [standalone]


#88111

FromΓ–ΓΆ Tiib <ootiib@hot.ee>
Date2022-12-20 01:36 -0800
Message-ID<63d00893-d4b0-4f90-bd23-9ea6130f9c69n@googlegroups.com>
In reply to#88064
On Monday, 19 December 2022 at 19:12:37 UTC+2, gdo...@gmail.com wrote:
> 
> hey and if we are going to have revisions how about adding yes and no, we now have true and false. 

The "true"/"false" sound most neutral, abstract and mathematical. Every other
dual meaning like "yes"/"no", "on"/"off", "in"/"out", "is"/"isn't", "correct"/"incorrect", 
"enabled"/"disabled" etc. are context-dependent and confusing in other context.
As we have boolean it is pointless to add those others to language for confusion.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.c++


csiph-web