More D Features Working Their Way Into C++

Tejas notrealemail at gmail.com
Sun Nov 27 03:14:03 UTC 2022


On Sunday, 27 November 2022 at 03:12:37 UTC, Tejas wrote:
> On Sunday, 27 November 2022 at 01:22:57 UTC, zjh wrote:
>> On Sunday, 27 November 2022 at 00:20:08 UTC, Walter Bright 
>> wrote:
>>> https://twitter.com/WalterBright/status/1596658148932489218
>>
>>
>> I can't access Twitter.
>> But `big languages`, especially the strategy of `C++`, just 
>> follow others. Any language with new ideas will be copied.
>> Therefore, small languages like `D` should first consolidate 
>> the existing implementation.
>
> Basically the `!` syntax used by our templates has been 
> developed into [`Circle`](https://www.circle-lang.org/), not 
> `C++`
>
> It looks like this
> ```cpp
>
> template![int N]
> void func(int i){ return N;}
> // Used like
> int d = func!44;
> ```

Correct code 😅

```cpp

  template![int N]
  int func(int i){ return N;}
  // Used like
  int d = func!44;

```


More information about the Digitalmars-d mailing list