J
James Kanze
The one above is the only constructor (once you declare/define one, the
compiler does not).
Not quite. There's also a compiler generated copy constructor.
The one above is the only constructor (once you declare/define one, the
compiler does not).
JohnQ wrote in message...
The one above is the only constructor (once you declare/define one, the
compiler does not).
You seem reluctant to believe that POD struct/class have the guts
supplied.
Try this:
James Kanze wrote in message...
Thanks James. I posted late night, and started to re-post an
addition, but, was talking about constructors only.
Copy-constructors are, to me, an separate column.
Like the old Chinese restaurant menu, one from column A,
one from column B, etc. (Ctor, CCtor, op=, Dtor).
(what, two from column A?
that will be another $2.75! only one in col D, the Dessert-tor (when you
finish that, the meal is over.)).
Without an constructor, a copy-constructor seems pretty
useless (how would you get an instance to copy? <G>).
Well how about leaving 'struct' alone and defining a new keyword:
'PODStruct'? Then even "no padding or aligning allowed" could be also
included in the spec making for some nice IO scenarios. Slowly, 'struct'
would be deprecated.
John
'no padding or aligning allowed', would that be a requirement, if so
it ain't gonna be very portable !!!!
Geo said:'no padding or aligning allowed', would that be a requirement, if so
it ain't gonna be very portable !!!!
It will be when hardware vendors get their acts together. Until then, I'll
just byte-align on WinTel and not worry about Sparcs and Crays. Anyways, if
you want to give the compiler free reign to do what it wants, use the
'class' keyword instead of PODStruct, as they are different animals for
different purposes (in the hypothetical scenario given).
John
"Geo" <[email protected]> wrote in message
It will be when hardware vendors get their acts together.
Until then, I'll just byte-align on WinTel
"Geo" <[email protected]> wrote in message
It will be when hardware vendors get their acts together.
Until then, I'll just byte-align on WinTel
On Aug 1, 1:29 am, "JohnQ" <[email protected]>
wrote:[...]It will be when hardware vendors get their acts together.'no padding or aligning allowed', would that be a
requirement, if so it ain't gonna be very portable !!!!"They have their acts together. It's you that don't seem to
understand."I won't be buying that Brooklyn bridge either, thank you.
You won't be writing any good software, either.
"And pay an extremely high performance penalty for it."You're assuming that byte-aligning struct members implies non-optimum
alignment. That's a wrong assumption. And perhaps you're thinking that
everything has to be byte-aligned or not, which isn't the case either."More than a few applications can't afford that."There is no penalty if you define your stucts correctly so that the data
members align.
Which, of course, depends on the machine.
Secondly, the vast majority of applications are not
performance constrained. Indeed, they are IO constrained if
anything, so not having to marshal will speed up the program
(on the "native" platform).
You always have to marshall. Objects aren't just arrays of
bytes, regardless of what you think.
(FWIW: our applications are very IO bound. That's why we use
Sparc's, and not PC's.)
On Aug 1, 1:29 am, "JohnQ" <[email protected]>
wrote:[...]It will be when hardware vendors get their acts together.'no padding or aligning allowed', would that be a
requirement, if so it ain't gonna be very portable !!!!"They have their acts together. It's you that don't seem to
understand."I won't be buying that Brooklyn bridge either, thank you.
"You won't be writing any good software, either."
More propoganda.
"And pay an extremely high performance penalty for it."You're assuming that byte-aligning struct members implies non-optimum
alignment. That's a wrong assumption. And perhaps you're thinking that
everything has to be byte-aligned or not, which isn't the case either."More than a few applications can't afford that."There is no penalty if you define your stucts correctly so that the data
members align.
"Which, of course, depends on the machine."
Designate one as primary.
Secondly, the vast majority of applications are not
performance constrained. Indeed, they are IO constrained if
anything, so not having to marshal will speed up the program
(on the "native" platform).
"You always have to marshall. Objects aren't just arrays of
bytes, regardless of what you think."
"Objects" has too much connotation. You can make something that is "just an
array of bytes". Indeed, that is fundamental and any language that doesn't
facilitate that is defficient (or trying to sell compilers).
John
On Aug 1, 12:58 pm, "JohnQ" <[email protected]>
wrote:On Aug 1, 1:29 am, "JohnQ" <[email protected]>
wrote:
[...]
'no padding or aligning allowed', would that be a
requirement, if so it ain't gonna be very portable !!!!
It will be when hardware vendors get their acts together.
"They have their acts together. It's you that don't seem to
understand."
I won't be buying that Brooklyn bridge either, thank you."You won't be writing any good software, either."
More propoganda.
Designate one as primary.
"Objects" has too much connotation. You can make something
that is "just an array of bytes".
Indeed, that is fundamental and any language that doesn't
facilitate that is defficient (or trying to sell compilers).
On Aug 1, 12:58 pm, "JohnQ" <[email protected]>
wrote:On Aug 1, 1:29 am, "JohnQ" <[email protected]>
wrote:
[...]
'no padding or aligning allowed', would that be a
requirement, if so it ain't gonna be very portable !!!!
It will be when hardware vendors get their acts together.
"They have their acts together. It's you that don't seem to
understand."
I won't be buying that Brooklyn bridge either, thank you."You won't be writing any good software, either."
More propoganda.
Designate one as primary.
"Objects" has too much connotation. You can make something
that is "just an array of bytes".
Indeed, that is fundamental and any language that doesn't
facilitate that is defficient (or trying to sell compilers).
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.