On Sunday, 4 March 2018 at 20:07:06 UTC, visitor wrote:
On Sunday, 4 March 2018 at 19:53:59 UTC, ag0aep6g wrote:
On 03/04/2018 08:45 PM, ag0aep6g wrote:
I don't know what's going on here. The error message doesn't
make sense to me. Might be a bug in the compiler.
This one works:
struct
On Sunday, 4 March 2018 at 19:53:59 UTC, ag0aep6g wrote:
On 03/04/2018 08:45 PM, ag0aep6g wrote:
I don't know what's going on here. The error message doesn't
make sense to me. Might be a bug in the compiler.
This one works:
struct Stack(T) {
T[] stack;
alias stack this;
bool
I had the same issue, happens with any conflicting selective
import.
It seems to work if you dont use selective imports, but importing
it inside the function if possible is a better option.
On 03/04/2018 08:45 PM, ag0aep6g wrote:
I don't know what's going on here. The error message doesn't make sense
to me. Might be a bug in the compiler.
This one works:
struct Stack(T) {
T[] stack;
alias stack this;
bool empty() {return empty(stack);} /* not using UFCS */
im
On 03/04/2018 08:17 PM, Dennis wrote:
I was making a stack interface for an array:
```
struct Stack(T) {
import std.array: empty;
T[] stack;
alias stack this;
}
void main()
{
Stack!int stack;
bool x = stack.empty;
}
```
My expectation is that you can now call `empty` on
I was making a stack interface for an array:
```
struct Stack(T) {
import std.array: empty;
T[] stack;
alias stack this;
}
void main()
{
Stack!int stack;
bool x = stack.empty;
}
```
My expectation is that you can now call `empty` on a stack
instance since I imported it in the