[OT] Generative C++
Timon Gehr via Digitalmars-d
digitalmars-d at puremagic.com
Thu Aug 3 14:04:14 PDT 2017
On 03.08.2017 22:54, Joakim wrote:
> On Thursday, 3 August 2017 at 19:02:17 UTC, Timon Gehr wrote:
>> On 03.08.2017 20:32, 12345swordy wrote:
>>> On Thursday, 3 August 2017 at 10:43:50 UTC, Kagamin wrote:
>>>> On Wednesday, 2 August 2017 at 20:28:38 UTC, 12345swordy wrote:
>>>>> ...No? I was referring to the c++ proposal paper.
>>>>
>>>> The paper doesn't propose to enforce coding standards to the point
>>>> you want. D already does what the paper proposes.
>>> Page 2:
>>>
>>> "Enable writing
>>> compiler-enforced
>>> patterns for any purpose:
>>> coding standards
>>> (e.g., many
>>> Core Guidelines
>>> “enforce” rules)
>>> "
>>>
>>> Yes, it does, right there. Are you reading the same paper that I am?
>>
>> On 02.08.2017 15:50, 12345swordy wrote:
>>> > Is it to much to ask for d developers to provide a way to enforce
>>> custom
>>> coding standards in a similar fashion that @nogc and @safe does?
>>
>> How would you use the proposed features to implement @safe or @nogc
>> within C++?
>
> I think you misread him.
It's very possible that there has been a misunderstanding, but I think
then it happened earlier in the thread.
> He wants to enforce custom coding standards in
> D similar to how that proposal would allow, and he's comparing it to how
> D does it with attributes for @safe and @nogc, but he's not asking about
> @safe and @nogc specifically.
> Presumably, he's wondering if he can apply
> other attributes in D that could be used to enforce coding standards
> similar to the ones that C++ proposal enables.
If this is the case, then the answer is that D has similarly powerful
compile-time reflection. The C++ proposal additionally has nice syntax
to invoke the checks and can conveniently rewrite the implementation
in-place (which is not possible in D in the same way). Another thing the
C++ proposal has that is not in D is the ability to conveniently
integrate custom error messages with built-in ones.
More information about the Digitalmars-d
mailing list