On Thursday, 26 August 2021 at 19:31:54 UTC, DLearner wrote:
if (typeof(v).stringof == "int" ) {
Tip: you can instead of string of do
if (is(typeof(v) == int))
That is operator lets you compare types directly.
(stringof is something you will almost never use as you learn
more of the
On Thursday, 26 August 2021 at 16:28:22 UTC, Adam D Ruppe wrote:
On Thursday, 26 August 2021 at 16:16:55 UTC, DLearner wrote:
Please confirm that mixins of format:
You really shouldn't use string mixins like this at all. If you
want to work with a variable, pass the variable itself as an
On Thursday, 26 August 2021 at 18:07:48 UTC, Ali Çehreli wrote:
In some cases it's more useful to have a 'static if' inside a
single function template instead of two separate function
templates.
In most cases that's better. A template constraint is really a
way to say "this template cannot
On 8/26/21 10:45 AM, Adam D Ruppe wrote:
On Thursday, 26 August 2021 at 17:39:16 UTC, Ali Çehreli wrote:
String mixins are appealing because they can inject code like C macros
do. It's not trivially possible to do the same with template mixins.
Template mixins are great, but obviously totally
On Thursday, 26 August 2021 at 17:39:16 UTC, Ali Çehreli wrote:
String mixins are appealing because they can inject code like C
macros do. It's not trivially possible to do the same with
template mixins.
Template mixins are great, but obviously totally inappropriate
here. I'm just talking
On 8/26/21 10:06 AM, Adam D Ruppe wrote:
On Thursday, 26 August 2021 at 17:01:06 UTC, DLearner wrote:
The object was to take a variable, and do alternative things with it
depending on (say) whether it was an 'int' or an 'int*'.
That's *very* easy to do with the alias. You can just check
On Thursday, 26 August 2021 at 17:01:06 UTC, DLearner wrote:
The object was to take a variable, and do alternative things
with it depending on (say) whether it was an 'int' or an 'int*'.
That's *very* easy to do with the alias. You can just check
`typeof(v)` in there.
On Thursday, 26 August 2021 at 16:28:22 UTC, Adam D Ruppe wrote:
On Thursday, 26 August 2021 at 16:16:55 UTC, DLearner wrote:
Please confirm that mixins of format:
You really shouldn't use string mixins like this at all. If you
want to work with a variable, pass the variable itself as an
On Thursday, 26 August 2021 at 16:16:55 UTC, DLearner wrote:
Please confirm that mixins of format:
You really shouldn't use string mixins like this at all. If you
want to work with a variable, pass the variable itself as an
argument to the function and use it with regular code instead of
On Thursday, 26 August 2021 at 16:16:55 UTC, DLearner wrote:
Please confirm that mixins of format:
```
string mxn1(string VarName) {
...
}
```
Invoked like:
```
mixin(mxn1("Var1"));
```
Have a wider scope than mixins like:
```
string mxn2(string VarName)() {
...
}
```
In
Please confirm that mixins of format:
```
string mxn1(string VarName) {
...
}
```
Invoked like:
```
mixin(mxn1("Var1"));
```
Have a wider scope than mixins like:
```
string mxn2(string VarName)() {
...
}
```
Invoked like:
```
mixin(mxn2!"Var2");
```
I tried direct r
11 matches
Mail list logo