On Sunday, 1 October 2017 at 06:27:21 UTC, Nicholas Wilson wrote:
And am getting
util.d(72,12): Error: template instance helper!(foo) cannot use
local 'foo' as parameter to non-global template
helper(Fields...)
Fixed by making helper a global template.
Thanks Jonathan!
On Sunday, October 01, 2017 05:57:53 Tony via Digitalmars-d-learn wrote:
> "@property functions can only have zero, one or two parameters"
>
> I am looking for an example of an @property function defined with
> two parameters and the syntax for how it is accessed without ().
If it has two paramete
On Sunday, 1 October 2017 at 04:44:16 UTC, Jonathan M Davis wrote:
I don't see any reason why the compiler would be complaining
about 'this' being required.
Neither do I.
I would think that that would imply that the compiler thinks
that you're accessing the member rather than introspecting on
"@property functions can only have zero, one or two parameters"
I am looking for an example of an @property function defined with
two parameters and the syntax for how it is accessed without ().
Oh, struct/class semantics really confuses me!
On Sunday, October 01, 2017 03:11:15 Nicholas Wilson via Digitalmars-d-learn
wrote:
> On Sunday, 1 October 2017 at 02:29:57 UTC, Jonathan M Davis wrote:
> > I would have thought that it would be pretty straightforward to
> > just write a recursive, eponymous template to solve the problem
> > and h
On Sunday, 1 October 2017 at 02:29:57 UTC, Jonathan M Davis wrote:
I would have thought that it would be pretty straightforward to
just write a recursive, eponymous template to solve the problem
and have it recursively build a single string to mix in for
everything.
In general though, without
On Sunday, October 01, 2017 02:07:26 Nicholas Wilson via Digitalmars-d-learn
wrote:
> On Sunday, 1 October 2017 at 01:05:56 UTC, Nicholas Wilson wrote:
> > struct MyType
> > {
> >
> > void* raw;
> > static struct Info
> > {
> >
> > @(42) int foo;
> >
> > }
> > mixin gen
On Sunday, 1 October 2017 at 01:05:56 UTC, Nicholas Wilson wrote:
struct MyType
{
void* raw;
static struct Info
{
@(42) int foo;
}
mixin generateGetInfo!MyTypeGetInfo;
}
extern(C) void MyTypeGetInfo(void*,int,size_t,void*size_t*);
mixin template generateGetInfo(alias
struct MyType
{
void* raw;
static struct Info
{
@(42) int foo;
}
mixin generateGetInfo!MyTypeGetInfo;
}
extern(C) void MyTypeGetInfo(void*,int,size_t,void*size_t*);
mixin template generateGetInfo(alias func)
{
foreach(field; typeof(this).Info.tupleof)
{
On Sunday, October 01, 2017 00:56:23 SrMordred via Digitalmars-d-learn
wrote:
> > In order to know where to split, it really has to do it from
> > the front. If it starts from the back, you won't necessarily
> > split in the same places as when iterating from the front, and
> > that would violate
In order to know where to split, it really has to do it from
the front. If it starts from the back, you won't necessarily
split in the same places as when iterating from the front, and
that would violate how bidirectional ranges are supposed to
work (the elements should be the same - just in re
I have to display images with a few controls: alpha channel,
rotation, scaling, cropping. Generally it should be png but I
want to be able to handle many images. The images will be memory
based(I'll load the file in to memory then) and will be displayed
in a drawing area.
Any ideas how to go
On Saturday, September 30, 2017 20:18:25 Jon Degenhardt via Digitalmars-d-
learn wrote:
> On Saturday, 30 September 2017 at 17:17:17 UTC, SrMordred wrote:
> > writeln( "a.b.c".splitter('.').dropBack(1) ); //compiles ok
> > writeln( "a.b.c".splitter(".").dropBack(1) );
> >
> > //error:
> > Error: te
On Saturday, 30 September 2017 at 17:17:17 UTC, SrMordred wrote:
writeln( "a.b.c".splitter('.').dropBack(1) ); //compiles ok
writeln( "a.b.c".splitter(".").dropBack(1) );
//error:
Error: template std.range.dropBack cannot deduce function from
argument types !()(Result, int), candidates are:
(.
On Saturday, 30 September 2017 at 19:26:14 UTC, SrMordred wrote:
For "a.b.c"splitter(x), Range r is a string, r.front is a
char. The template can only be instantiated if the predicate
function is valid. The predicate function is "a == b". Since
r.front is a char, then s must be a type that can
For "a.b.c"splitter(x), Range r is a string, r.front is a
char. The template can only be instantiated if the predicate
function is valid. The predicate function is "a == b". Since
r.front is a char, then s must be a type that can be compared
with '=='. A string and char cannot be compared with
On Saturday, 30 September 2017 at 18:21:11 UTC, Jon Degenhardt
wrote:
On Saturday, 30 September 2017 at 17:17:17 UTC, SrMordred wrote:
[...]
It's easy to overlook, but documentation for splitter starts
out:
Lazily splits a range using an element as a separator.
An element of a string
Hello, can I make AliasSeq not inside template function, for
example I want add function called `registerComponent` which will
add the components classes to list and based on this generated
list I want add additional fields inside `ComponentsManager`.
Example:
Registering components:
struct M
On Saturday, 30 September 2017 at 17:17:17 UTC, SrMordred wrote:
writeln( "a.b.c".splitter('.').dropBack(1) ); //compiles ok
writeln( "a.b.c".splitter(".").dropBack(1) );
//error:
Error: template std.range.dropBack cannot deduce function from
argument types !()(Result, int), candidates are:
(.
writeln( "a.b.c".splitter('.').dropBack(1) ); //compiles ok
writeln( "a.b.c".splitter(".").dropBack(1) );
//error:
Error: template std.range.dropBack cannot deduce function from
argument types !()(Result, int), candidates are:
(...)
Hm.. can someone explain whats going on?
On Saturday, 30 September 2017 at 07:41:21 UTC, Igor wrote:
On Friday, 29 September 2017 at 22:13:01 UTC, Jon Degenhardt
wrote:
Have there been any investigations into using region-based
memory management (aka memory arenas) in D, possibly in
conjunction with GC allocated memory?
Sounds like
Hello all
only for learning purposes and my interest for deeper network
programming. I wanted to write a program and filter the entire
traffic in my network. I have a server and various computers in
my network, but I dont know, as I in D the promiscous mode for
sockets can switch on.
Is thi
On Saturday, 30 September 2017 at 10:09:43 UTC, Mike Wey wrote:
On 30-09-17 03:27, Tony wrote:
One thing I picked up from SCons is creating dynamic object
files with a .os extension and static object files with the
standard .o extension. That way they can be compiled in the
same directory in t
On Saturday, 30 September 2017 at 12:42:17 UTC, Steven
Schveighoffer wrote:
I think the problem may be that derived classes' tupleof has
some of the same variables as the base class?
I agree it should work, but I think if it did work, it may not
be what you want. You would see a lot of repea
On Saturday, 30 September 2017 at 12:07:21 UTC, Nicholas Wilson
wrote:
Hmm. Everything except for the main function was in a different
module, I dont see why that would cause it to not be run, but
then bugs have a tendency to do strange things like that. I'll
have to dust mite DCompute and see
On 9/29/17 11:39 PM, bitwise wrote:
As far as I can tell, this code should compile:
class B { int a; }
class D1 : B { int b; }
class D2 : D1 { int c; }
template TupleOf(Classes...)
{
static if(Classes.length > 1)
alias TupleOf = AliasSeq!(Classes[0].tupleof,
TupleOf!(Class
On Saturday, 30 September 2017 at 08:49:14 UTC, user1234 wrote:
On Saturday, 30 September 2017 at 06:15:41 UTC, Nicholas Wilson
wrote:
No "initialising onError", the static this is not even being
run!
I'm using LDC master.
See also https://github.com/libmir/dcompute/issues/32
LDC 1.4, DMD 2.
On 30-09-17 03:27, Tony wrote:
One thing I picked up from SCons is creating dynamic object files with a
.os extension and static object files with the standard .o extension.
That way they can be compiled in the same directory in the same build
step. But dmd rejects the files that are named *.os
On Saturday, 30 September 2017 at 09:27:23 UTC, Shigeki Karita
wrote:
https://dpaste.dzfl.pl/cd605899d050
why this code cannot convert to foreach (over Structs and
Classes with Ranges).
auto h = new BinaryHeap!(int[])(new int[0]);
typeof(h).stringof.writeln;
static assert(isInputR
https://dpaste.dzfl.pl/cd605899d050
why this code cannot convert to foreach (over Structs and Classes
with Ranges).
auto h = new BinaryHeap!(int[])(new int[0]);
typeof(h).stringof.writeln;
static assert(isInputRange!(typeof(h)));
h.insert(3);
h.insert(1);
h.insert(2);
On Saturday, 30 September 2017 at 08:20:44 UTC, Nicholas Wilson
wrote:
struct MyType
{
void* ptr;
static struct Info
{
@(42) int foo;
}
// Should be generated by the mixin below
@property int foo()
{
int ret;
getMyTypeInfo(ptr,42,int.sizeof,&
On Friday, 29 September 2017 at 22:15:44 UTC, Mengu wrote:
On Friday, 29 September 2017 at 02:34:08 UTC, DreadKyller wrote:
[...]
+1 for forum issue.
+1 please...
On Saturday, 30 September 2017 at 06:15:41 UTC, Nicholas Wilson
wrote:
No "initialising onError", the static this is not even being
run!
I'm using LDC master.
See also https://github.com/libmir/dcompute/issues/32
LDC 1.4, DMD 2.076, DMD ~master and finally GDC all give the
expected result he
struct MyType
{
void* ptr;
static struct Info
{
@(42) int foo;
}
// Should be generated by the mixin below
@property int foo()
{
int ret;
getMyTypeInfo(ptr,42,int.sizeof,&ret);
return ret;
}
mixin generateInfo!getMyTypeInfo;
}
On Saturday, 30 September 2017 at 07:45:27 UTC, Jacob Carlborg
wrote:
On 2017-09-30 08:56, Tony wrote:
The documentation says:
--
This module contains bindings to selected types and functions
from the
standard C header . Note that this is not
On 2017-09-30 08:56, Tony wrote:
The documentation says:
--
This module contains bindings to selected types and functions from the
standard C header . Note that this is not automatically
generated, and may omit some types/functions from the orig
On Friday, 29 September 2017 at 22:13:01 UTC, Jon Degenhardt
wrote:
Have there been any investigations into using region-based
memory management (aka memory arenas) in D, possibly in
conjunction with GC allocated memory? This would be a very
speculative idea, but it'd be interesting to know if
The documentation says:
--
This module contains bindings to selected types and functions
from the standard C header . Note that this is not
automatically generated, and may omit some types/functions from
the original C header.
---
39 matches
Mail list logo