On 2010-05-23 23.36, Andrei Alexandrescu wrote:
I've thought for a very long time about the class vs. struct choice in a
container, and I came to a startling conclusion: it (almost) doesn't
matter. Could be either, and the tradeoffs involved are nonessential.
Here they are:
1. Using a class
On 2010-05-24 00.06, bearophile wrote:
Andrei Alexandrescu:
1. Using a class makes implementing members easier because there's no
need to do work through an additional member. With a struct, you need a
pimpl approach. For example:
struct Array {
struct Impl {
...
}
On Sun, 23 May 2010 17:36:52 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
I've thought for a very long time about the class vs. struct choice in a
container, and I came to a startling conclusion: it (almost) doesn't
matter. Could be either, and the tradeoffs involved are
On 05/24/2010 10:58 AM, Steven Schveighoffer wrote:
On Sun, 23 May 2010 17:36:52 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
I've thought for a very long time about the class vs. struct choice in
a container, and I came to a startling conclusion: it (almost) doesn't
matter.
Andrei Alexandrescu:
Oh, and the monitor isn't needed so that's an unused word there. I'd
forgotten about it.
It can be invented some kind of property or pragma for classes, to remove the
monitor from all the instances of that class. I don't know if this can be done,
if it is useful, and if
On Mon, 24 May 2010 12:18:02 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
On 05/24/2010 10:58 AM, Steven Schveighoffer wrote:
On Sun, 23 May 2010 17:36:52 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
I've thought for a very long time about the class
I've thought for a very long time about the class vs. struct choice in a
container, and I came to a startling conclusion: it (almost) doesn't
matter. Could be either, and the tradeoffs involved are nonessential.
Here they are:
1. Using a class makes implementing members easier because there's
Andrei Alexandrescu:
1. Using a class makes implementing members easier because there's no
need to do work through an additional member. With a struct, you need a
pimpl approach. For example:
struct Array {
struct Impl {
...
}
Impl * impl;
...
On 2010-05-23 17:36:52 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org said:
I've thought for a very long time about the class vs. struct choice in
a container, and I came to a startling conclusion: it (almost) doesn't
matter. Could be either, and the tradeoffs involved are
On 05/23/2010 05:06 PM, bearophile wrote:
Andrei Alexandrescu:
1. Using a class makes implementing members easier because there's no
need to do work through an additional member. With a struct, you need a
pimpl approach. For example:
struct Array {
struct Impl {
...
}
10 matches
Mail list logo