Subject: Re: [boost] [concept_check] Some issues
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2011-12-02 08:30:54
Robert Kawulak wrote:
> > From: Stewart, Robert
> > > - The implementation of assignable_archetype defines
> > > private default and copy constructors, so for example
> > > assignable_archetype<copy_constructible_archetype<>> will
> > > not actually be copy constructible. The same for
> > > convertible_to_archetype and convertible_from_archetype,
> > > but additionally with copy assignment. Is this by purpose?
> > I should think that's by design. The archetypes are to
> > validate a particular concept checking class, so a copyable
> > or default constructible archetype for Assignable would be
> > wrong.
> I wouldn't say it's wrong. If you can combine several concepts,
> you should be able to combine the corresponding archetypes too.
> If your template requires more than one concept (e.g., a type
> that is BOTH copyable AND assignable), then without the ability
> of chaining you would have to write your own archetypes in all
> but the most trivial cases.
I would. The purpose of an Assignable archetype is to test that a type that is assignable, but possibly neither default nor copy constructible, satisfies the concept. That is, the Assignable concept checker should not impose *any* other criteria on its parameterizing type.
> > Are archetypes are supposed to be composable?
> I guess they are since most of them have the Base template
> > Even if so, not all combinations are possible.
> Could you give an example of an impossible combination?
The OP's! Seriously, my point is that making a particular archetype restrict its interface might generally prevent certain combinations. In order to make the Assignable archetype neither default nor copy constructible, to ensure that the concept checker doesn't require those capabilities, it cannot be combined with CopyConstructible's or DefaultConstructible's archetypes, at least not as the derivate.
Rob Stewart robert.stewart_at_[hidden]
Software Engineer using std::disclaimer;
Dev Tools & Components
Susquehanna International Group, LLP http://www.sig.com
IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.