On Wednesday, 29 November 2023 at 13:31:14 UTC, DLearner wrote:
```
Error: found `End of File` when expecting `;` following
statement
```
If an extra ; is added:
```
}(` ~ strStartPtr ~ `,` ~ strPLPtr ~ `);`;
```
it works but doesn't seem correct.
This is an annoying limitation of the D
On Wednesday, 29 November 2023 at 13:31:14 UTC, DLearner wrote:
it works but doesn't seem correct.
You're mixing in an expression that creates an empty function and
calls it. What do you want it to do?
The code:
```
void main() {
struct SB {
char SBChrFld1;
char SBChrFld2;
int SBIntFld1;
int SBIntFld2;
}
SB SBVar;
SB* wkSBPtr;
void* StartPtr1 = null;
mixin(mxnDelMbr("StartPtr1", "wkSBPtr"));
return;
}
string mxnDelMbr()(string strStartPt
On 03/05/2014 03:10 PM, Frustrated wrote:
>> assert(s.Do(1, 2.5) == 3.5);
> And this is exactly what I don't what!
Sorry, I've completely misunderstood. :)
> Do, in my case, is a ctfe used
> only at compile time to make it easy to generate code. It's not needed
> at runtime and does not be
On Wednesday, 5 March 2014 at 23:33:25 UTC, Frustrated wrote:
Maybe the problem isn't what I thought it was. I created a test
case that works:
import std.stdio, std.cstream;
mixin template C()
{
alias A = typeof(this);
mixin(B!(A));
}
template B(T)
{
pragma(msg, T);
e
Maybe the problem isn't what I thought it was. I created a test
case that works:
import std.stdio, std.cstream;
mixin template C()
{
alias A = typeof(this);
mixin(B!(A));
}
template B(T)
{
pragma(msg, T);
enum B() { return "string foo() { return `<"~T.stringof~">`; }";
On Wednesday, 5 March 2014 at 23:04:06 UTC, Ali Çehreli wrote:
On 03/05/2014 02:37 PM, Frustrated wrote:
>> import std.typetuple;
>>
>> template fooImpl(T...)
>> {
>> static assert(is (T[0] == S));// <-- COOL!
>> static assert(is (T[1] == int));
>> static assert(is (T[2] == doubl
On 03/05/2014 03:04 PM, Ali Çehreli wrote:
template Do(T...)
{
mixin DoImpl!(TypeTuple!(typeof(this), T));
Actually, TypeTuple is not needed there:
mixin DoImpl!(typeof(this), T);
Ali
On 03/05/2014 02:37 PM, Frustrated wrote:
>> import std.typetuple;
>>
>> template fooImpl(T...)
>> {
>> static assert(is (T[0] == S));// <-- COOL!
>> static assert(is (T[1] == int));
>> static assert(is (T[2] == double));
>> }
>>
>> template foo(T...)
>> {
>> alias foo = fooIm
On 03/05/2014 01:30 PM, Frustrated wrote:
I am trying to remove the unnecessary passing of the type of class to a
template but can't seem to get it to work:
see
The code is the
mixin(AbstractToInterface!(WindowsGui, iButton, WindowsButton,
iBorder, WindowsBorder));
which I want to not
On Wednesday, 5 March 2014 at 22:35:46 UTC, Ali Çehreli wrote:
On 03/05/2014 01:30 PM, Frustrated wrote:
I am trying to remove the unnecessary passing of the type of
class to a
template but can't seem to get it to work:
see
The code is the
mixin(AbstractToInterface!(WindowsGui, iButto
I am trying to remove the unnecessary passing of the type of
class to a template but can't seem to get it to work:
see
The code is the
mixin(AbstractToInterface!(WindowsGui, iButton, WindowsButton,
iBorder, WindowsBorder));
which I want to not have to specify WindowsGui.
I've t
Christopher Wright wrote:
Mike L. wrote:
If the compiler can tell that B!(int) is a type, why can't it tell
that it is a child class of A!(int) ?
This is a bug. In template specializations, : means equality. In static
if, : means convertibility.
This is only with template specializations in
Mike L. wrote:
If the compiler can tell that B!(int) is a type, why can't it tell that it is a
child class of A!(int) ?
This is a bug. In template specializations, : means equality. In static
if, : means convertibility.
So, you can use:
template ADefaults(Type, AType)
{
static asser
Hello,
I was wondering why the following does not work:
interface A(Type)
{ Type blah(); }
template ADefaults(Type, AType : A!(Type))
{
Type blah()
{ return Type.init; }
}
class B(Type) : A!(Type)
{ mixin ADefaults!(Type, B!(Type)); }
void main()
15 matches
Mail list logo