On Tuesday, 3 May 2016 at 12:31:10 UTC, Benjamin Thaut wrote:
I assume this is on windows? Yes its a known issue (I know
No, the problem occurs on my Linux aswell.
Hello,
I failed to find some code example for a template class/struct
that accept a function/delegate as template argument. All
examples I could find use simple value types like int or double.
I piggy bag another question. Defining a function/delegate as
function argument is shown in exampl
On Sunday, 1 May 2016 at 05:42:00 UTC, Ali Çehreli wrote:
On 04/30/2016 10:05 PM, Joel wrote:
> This has no effect:
> _bars.each!(a => { a._plots.fillColor = Color(255, 180, 0);
});
This is a common issue especially for people who know lambdas
from other languages. :)
Your lambda does not do
On Wednesday, 4 May 2016 at 01:44:31 UTC, Adam D. Ruppe wrote:
Is there a file called object.d in your current directory?
Not anymore,
Thanks for pointing that out
Is there a file called object.d in your current directory?
I have run into an issue compiling with dmd (version 2.071.0), it
seems that the 'size_t' alias isn't resolving properly. I was
wondering if someone has run into this before and if this is a
bug or something I'm doing wrong? My call to dmd is:
..dmd2\windows\bin\dmd.exe -run hello.d -de -w -un
You're close.
An `alias` template parameter can be any symbol, including a
template. But you can't pass in a template as a runtime
parameter, so having `F f` in your parameters list is wrong
(there's nothing to pass anyway; you already have the template,
which is F).
static void call(alias
I don't think it's possible to call a vararg function whose
number of arguments is only known at runtime, for the same
reasons it is impossible in C [1].
Your switch statement is probably the best you can do, other
than rewriting the API to not use varargs (which, depending on
what the functi
On Tuesday, 3 May 2016 at 21:31:35 UTC, Erik Smith wrote:
C++ has template templates. I'm not sure how to achieve the
same effect where (in example below) the template function
myVariadic is passed to another function.
void myVaridatic(A...)(A a) {}
static void call(alias F,A
On 03.05.2016 23:31, Erik Smith wrote:
void myVaridatic(A...)(A a) {}
Aside: I think it's "variadic", not "varidatic".
static void call(alias F,A...)(F f,A a) {
static void call(alias f, A...)(A a) {
f(a);
}
void foo() {
call
On Monday, 2 May 2016 at 18:22:52 UTC, Erik Smith wrote:
Is there way to construct an "argument pack" from a non-static
array (like the switch below)? I need to transport a variadic
call through a void*.
switch (a.length) {
case 1: foo(a[1]); break;
case 2: foo(a[1], a[2]); break;
case
C++ has template templates. I'm not sure how to achieve the same
effect where (in example below) the template function myVariadic
is passed to another function.
void myVaridatic(A...)(A a) {}
static void call(alias F,A...)(F f,A a) {
f(a);
}
void f
On Monday, 2 May 2016 at 18:56:59 UTC, Stefan Koch wrote:
On Monday, 2 May 2016 at 18:22:52 UTC, Erik Smith wrote:
Is there way to construct an "argument pack" from a non-static
array (like the switch below)? I need to transport a variadic
call through a void*.
switch (a.length) {
case 1:
On Tuesday, 3 May 2016 at 12:48:37 UTC, Benjamin Thaut wrote:
It seems that one of the fmod functions you declared is not
correct. Either the fmod api is not using the c calling
convention or you made a mistake when declaring the paramters
of the fmod functions. You should double check that the
On Tuesday, 3 May 2016 at 16:13:07 UTC, ag0aep6g wrote:
On 03.05.2016 18:03, Jonathan Villa wrote:
Types are not values. You cannot return a type from a function.
Use aliases instead:
alias user_id_t = typeof(dummy1);
alias name_t = typeof(dummy2);
/* ... etc ... *
On 03.05.2016 18:03, Jonathan Villa wrote:
public final class accounts
{
public:
static table_user user;
}
public final class table_user
{
private:
static uint32 dummy1;
static string dummy2;
static DateTime dummy3;
static ubyte dummy4;
public final class accounts
{
public:
static table_user user;
}
public final class table_user
{
private:
static uint32 dummy1;
static string dummy2;
static DateTime dummy3;
static ubyte dummy4;
public:
static @property auto user_id_t() {
On Monday, 2 May 2016 at 17:43:56 UTC, Namespace wrote:
I still like
auto s(T, size_t n)(T[n] arr) {
return arr;
}
Wooah, this trick is awesome. But actually it does the same thing
that what I've proposed before. Exactly the same code is
generated. So I'd say that it's rather a
On Friday, 10 September 2010 at 15:15:38 UTC, Andrej Mitrovic
wrote:
Yeah, one would think the destination is on the left (just like
the standard C way of doing it), but it's not. I checked it in
the docs and the source. And idup works, thanks.
Kagamin Wrote:
Andrej Mitrovic Wrote:
> fo
On Tuesday, 3 May 2016 at 06:14:25 UTC, stunaep wrote:
FileDialog is showing a blank white window for me. Only tested
on windows 7 so far, but if I run dmledit, the filedialog on
there works fine. It's weird because I am using almost exactly
the same code.
Try fetch recent dlangui version (du
Oops! Stupid of me. There were three bugs in the code.
Correct code is as follow:
import std.stdio;
class Data
{
string m = "Hello world !";
}
struct IdxElem(D)
{
bool inUse;
D data;
}
IdxElem!(Data)[string] idx;
void main()
{
idx["test1"] = IdxElem!Data(true, new Data);
The following code does not compile and I don't understand why.
import std.stdio;
class Data
{
string m = "Hello world !";
}
struct IdxElem(D)
{
bool inUse;
D data;
}
IdxElem!Data[string] idx;
void main()
{
idx["test1"] = IdxElem(true, new Data);
idx["test2"] = IdxElem(fa
On Tuesday, 3 May 2016 at 12:12:04 UTC, Jonathan M Davis wrote:
On Tue, 3 May 2016 11:37:13 +0200
Steven Schveighoffer via Digitalmars-d-learn
wrote:
bleh, Object.opCmp only works with mutable objects. Which
means RedBlackTree cannot work with objects because it uses
inout to ensure your objec
On Tuesday, 3 May 2016 at 11:32:31 UTC, cc wrote:
Hello, I've been encountering a strange problem that seems to
occur after calling some external C functions. I've been
working on a program that incorporates the FMOD C API for
playing sound, with a simple D binding based off the C headers,
an
On Tuesday, 3 May 2016 at 10:52:20 UTC, Nordlöw wrote:
On Tuesday, 3 May 2016 at 10:48:51 UTC, Nordlöw wrote:
AFAICT, stacktraces are not emitted with debug information when
Should be static shared module constructors.
errors occur in static module constructors. Is this a know bug?
My stac
On Tue, 3 May 2016 11:37:13 +0200
Steven Schveighoffer via Digitalmars-d-learn
wrote:
> bleh, Object.opCmp only works with mutable objects. Which means
> RedBlackTree cannot work with objects because it uses inout to ensure
> your objects are not modified (since 2.068)
>
> It doesn't work with con
Hello, I've been encountering a strange problem that seems to
occur after calling some external C functions. I've been working
on a program that incorporates the FMOD C API for playing sound,
with a simple D binding based off the C headers, and actually
everything works more or less fine, I've
On Tuesday, 3 May 2016 at 10:48:51 UTC, Nordlöw wrote:
AFAICT, stacktraces are not emitted with debug information when
Should be static shared module constructors.
errors occur in static module constructors. Is this a know bug?
My stacktraces contain no information of the call stack so it's
AFAICT, stacktraces are not emitted with debug information when
errors occurr in static module constructors. Is this a know bug?
This is a big problem for me because, in my application, I've
realized unittests as functions called from within static shared
module constructors to elide the probl
On 5/3/16 5:10 AM, Dsby wrote:
this is the test Code:
import std.container.rbtree;
import std.stdio;
class TClass
{
int i;
}
void main()
{
RedBlackTree!(TClass) list = new RedBlackTree!(TClass)();
auto t = new TClass();
list.insert(t);
writeln("The rbtree length is ",
30 matches
Mail list logo