Connecting Tech Pros Worldwide Forums | Help | Site Map

sizeof(Struct::Member) rationale

petschy
Guest
 
Posts: n/a
#1: Sep 2 '08
Hello All,

I confronted recently with the fact that the size of a struct member
can't be determined with sizeof(Struct::Member). I'm aware of the
alternative methods to do this, however, I'm interested in the
rationale why the Struct::Member syntax is disallowed.

Thanks, P

Ian Collins
Guest
 
Posts: n/a
#2: Sep 2 '08

re: sizeof(Struct::Member) rationale


petschy wrote:
Quote:
Hello All,
>
I confronted recently with the fact that the size of a struct member
can't be determined with sizeof(Struct::Member). I'm aware of the
alternative methods to do this, however, I'm interested in the
rationale why the Struct::Member syntax is disallowed.
>
Was it even proposed?

If so, what benefits would it bring?

--
Ian Collins.
petschy
Guest
 
Posts: n/a
#3: Sep 2 '08

re: sizeof(Struct::Member) rationale


Was it even proposed?

I don't know.
Quote:
If so, what benefits would it bring?
I needed the size of a member, without an actual instance and the
syntax 'felt' natural. This could be done, so I just wondered why is
it disallowed.

P
Juha Nieminen
Guest
 
Posts: n/a
#4: Sep 3 '08

re: sizeof(Struct::Member) rationale


petschy wrote:
Quote:
I confronted recently with the fact that the size of a struct member
can't be determined with sizeof(Struct::Member). I'm aware of the
alternative methods to do this, however, I'm interested in the
rationale why the Struct::Member syntax is disallowed.
AFAIK, it will be allowed in the next standard.
Triple-DES
Guest
 
Posts: n/a
#5: Sep 3 '08

re: sizeof(Struct::Member) rationale


On 2 Sep, 22:42, petschy <pets...@gmail.comwrote:
Quote:
Hello All,
>
I confronted recently with the fact that the size of a struct member
can't be determined with sizeof(Struct::Member). I'm aware of the
alternative methods to do this, however, I'm interested in the
rationale why the Struct::Member syntax is disallowed.
>
Thanks, P
Hi. As Juha pointed out, this is already in the draft for the next
standard, but that does not really answer your question :).

You may find these links interesting:

http://www.open-std.org/JTC1/sc22/wg...fects.html#198
http://www.open-std.org/jtc1/sc22/wg...007/n2253.html

DP
petschy
Guest
 
Posts: n/a
#6: Sep 3 '08

re: sizeof(Struct::Member) rationale


You may find these links interesting:Indeed!
Thanks!
P
Closed Thread