[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] Delegating ctor uncalled for?
From: |
Greg Chicares |
Subject: |
Re: [lmi] Delegating ctor uncalled for? |
Date: |
Tue, 7 Mar 2017 13:29:00 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 |
On 2017-03-03 14:18, Vadim Zeitlin wrote:
> On Wed, 1 Mar 2017 12:52:58 +0000 Greg Chicares <address@hidden> wrote:
>
> GC> What do you think of the patch below[0]? The question I'm struggling with
> GC> is whether it's worth an extra fifty lines of code just to say "don't use
> GC> class SequenceParser directly"
[...]
> I'm afraid I can't say anything really original about this, but just
> repeat what I had already written before: yes, I do think the patch below
> improves things and I also think that [...snip...]
Focusing only on the 2017-03-01 patch...I just set out to apply it, and
started by trying to write a commit message describing its purpose, but
I'm stuck. What useful purpose does it accomplish?
Omitting the minor details (which may worth applying in their own right),
the patch changes this:
class parser {
public:
parser(argument_type); // This is the only public ctor.
result_type results() const;
};
into this:
class parser {
friend parser make_parser(argument_type);
public:
result_type results() const;
private:
parser(argument_type);
};
parser make_parser(argument_type args) {return parser(args);}
In what way is that an improvement?