Why does this:
enum AddrSpace {
Global,Shared
}
struct Pointer(AddrSpace as, T)
{
T* ptr;
alias ptr this;
}
struct AutoIndexed(T) if (is(T : Pointer!(n,U),AddrSpace n,U))
{
T p;
private @property auto idx()
{
static if (n == AddrSpace.Global)
return
Ignore, I was trying to analyse an uninstantiated template.
On Tuesday, 4 July 2017 at 23:27:25 UTC, Jean-Louis Leroy wrote:
I want to create a range that consists of the result of a map()
followed by a value, e.g.:
int[] x = [ 1, 2, 3];
auto y = map!(x => x * x)(x);
auto z = y ~ 99; // how???
I have tried several variations: convert 99 to a
On Friday, 28 April 2017 at 19:08:18 UTC, ParticlePeter wrote:
On Friday, 28 April 2017 at 17:57:34 UTC, Ali Çehreli wrote:
On 04/28/2017 08:56 AM, ParticlePeter wrote:
> C++ Function:
> bool cppFunc( float[3] color );
>
> D binding:
> extern(C++) bool cppFunc( float[3] color );
>
> Using with:
On Saturday, 29 July 2017 at 22:45:12 UTC, piotrekg2 wrote:
On Saturday, 29 July 2017 at 18:19:47 UTC, Johan Engelen wrote:
On Saturday, 29 July 2017 at 16:01:07 UTC, piotrekg2 wrote:
Hi,
I'm trying to port some of my c++ code which uses sse2
instructions into D. The code calls the following
On Friday, 28 July 2017 at 22:06:27 UTC, Ali Çehreli wrote:
I think it works:
template replace(T) {
template inside(Src...) {
template from(Dst...) {
import std.meta;
enum f = staticIndexOf!(T, Src);
static if (f == -1) {
alias
On Sunday, 6 August 2017 at 19:56:06 UTC, Johnson Jones wrote:
is it possible to do? I would like to pre-configure some stuff
at "pre-compilation"(in ctfe but before the rest of the program
actually gets compiled).
I know it's not safe and all that but in my specific case it
would help.
On Sunday, 6 August 2017 at 23:33:26 UTC, greatsam4sure wrote:
import std.math;
import std.stdio;
cos(90*PI/180) = -2.7e-20 instead of zero. I will appreciate
any help. thanks in advance.
tan(90*PI/180) = -3.689e+19 instead of infinity. What is the
best way to use this module
in addition
On Saturday, 19 August 2017 at 18:33:37 UTC, WhatMeWorry wrote:
Or maybe another approach would be to ask, what type is the
compiler replacing auto with.
If you want to find out compile with `-vcg-ast`
On Wednesday, 23 August 2017 at 09:53:49 UTC, biocyberman wrote:
I lost my momentum to learn D and want to gain it up again.
Therefore I need some help with this seemingly simple task:
# Fasta sequence
\>Entry1_ID header field1|header field2|...
On Sunday, 14 May 2017 at 10:18:40 UTC, ag0aep6g wrote:
On 05/14/2017 01:57 AM, Nicholas Wilson wrote:
1D arrays it doesn't, 2D or higher it does.
What do you mean? This works just fine as well:
import std.random;
import std.stdio;
int[2][2] testfunc(int num) @nogc
{
return [[0,
On Sunday, 14 May 2017 at 12:02:03 UTC, Eugene Wissner wrote:
On Sunday, 14 May 2017 at 11:45:12 UTC, ag0aep6g wrote:
On 05/14/2017 01:40 PM, Nicholas Wilson wrote:
dynamic array literals is what I meant.
I don't follow. Can you give an example in code?
void main()
{
ubyte[] arr = [ 1,
On Friday, 12 May 2017 at 21:26:01 UTC, Bastiaan Veelo wrote:
On Friday, 12 May 2017 at 15:24:52 UTC, k-five wrote:
A full version that I just added to my gitgub:
https://github.com/k-five/dren
You may like getopt[1] for command line argument parsing.
https://dlang.org/phobos/std_getopt.html
On Monday, 15 May 2017 at 06:44:53 UTC, Nordlöw wrote:
After having watched Jonathan Blow's talk on Jai
https://www.youtube.com/watch?v=TH9VCN6UkyQ=2880s
I realized that we should add his Array-of-Structures (AoS)
concept to Phobos, preferrably in std.typecons.StructArrays, as
something like
On Thursday, 11 May 2017 at 07:24:00 UTC, AntonSotov wrote:
import std.stdio;
int main()
{
auto big = File("bigfile", "r+"); //bigfile size 20 GB
writeln(big.size); // ERROR!
return 0;
}
//
std.exception.ErrnoException@std\stdio.d(1029): Could
On Wednesday, 10 May 2017 at 22:20:52 UTC, Nordlöw wrote:
What's fastest way to on-the-fly-decompress and process a
gzipped csv-fil line by line?
Is it possible to combine
http://dlang.org/phobos/std_zlib.html
with some stream variant of
File(path).byLineFast
?
I suggest you take a look
On Wednesday, 10 May 2017 at 12:40:41 UTC, k-five wrote:
I have a line of code that uses "to" function in std.conv for a
purpose like:
int index = to!int( user_apply[ 4 ] ); // string to int
When the user_apply[ 4 ] has value, there is no problem; but
when it is empty: ""
it throws an
On Saturday, 13 May 2017 at 18:32:16 UTC, Lewis wrote:
import std.random;
import std.stdio;
int[4] testfunc(int num) @nogc
{
return [0, 1, num, 3];
}
int main()
{
int[4] arr = testfunc(uniform(0, 15));
writeln(arr);
return 0;
}
I've read a bunch of stuff that seems to indicate
On Sunday, 14 May 2017 at 01:15:03 UTC, Lewis wrote:
On Saturday, 13 May 2017 at 19:22:09 UTC, Steven Schveighoffer
wrote:
It's just out of date. Can't remember the version, but this
did use to allocate. It doesn't any more. But only for this
case. In most cases it does allocate.
Okay cool,
Welcome!
On Thursday, 8 June 2017 at 07:32:44 UTC, Michael Reiland wrote:
A few questions:
- Is vibe.d the recommended way of doing web work?
Yes. Adam D. Ruppe also has some easy to use libraries that may
suit your need.
- Is that book worth purchasing?
Don't know.
- Does D have a
On Friday, 9 June 2017 at 16:56:46 UTC, ketmar wrote:
Petar Kirov [ZombineDev] wrote:
Do HexFloats (http://dlang.org/spec/lex#HexFloat) help?
hm. i somehow completely missed "%a" format specifier! yeah,
"-0x1.6ep-3" did the trick.
tnx. i should do my homework *before* posting big
On Sunday, 25 June 2017 at 11:39:27 UTC, Andrew Chapman wrote:
Hi guys, I'm a little confused as to whether D supports
interfaces with templates. I can compile OK, but linking
reports an error like this:
Error 42: Symbol Undefined
On Friday, 23 June 2017 at 07:51:51 UTC, Russel Winder wrote:
I am likely just staring at and missing the data needed:
How does one invoke dub to fetch and build, and put into a
place other that ~/.dub/… a package from Dub?
dub fetch foo --version=1.0.0
mv ~/.dub/packages/foo-1.0.0
On Tuesday, 23 May 2017 at 10:30:56 UTC, Alex wrote:
On Monday, 22 May 2017 at 21:44:17 UTC, ag0aep6g wrote:
With that kind of variadics, you're not dealing with a
template. A (run-time) variadic delegate is an actual
delegate, i.e. a value that can be passed around. But the
variadic stuff is
On Friday, 26 May 2017 at 15:17:08 UTC, drug wrote:
Trying to bind to cpp code I stop at some moment having
undefined reference to some cpp function. But objdump -Ct
cpplibrary.so shows me that this cpp function exists in the
library. linker message about cpp function is _identical_ to
On Friday, 19 May 2017 at 12:21:10 UTC, biocyberman wrote:
On Friday, 19 May 2017 at 09:17:04 UTC, Biotronic wrote:
On Friday, 19 May 2017 at 07:29:44 UTC, biocyberman wrote:
[...]
Question about your implementation: you assume the input may
contain newlines, but don't handle any other
On Sunday, 21 May 2017 at 05:18:33 UTC, Russel Winder wrote:
I am having a crisis of confidence. In two places I have
structurally:
datum.action()
.map!(…)
and then the fun starts as I need to actually do a flatMap. In
one of the two places I have to:
.array
.joiner;
but
On Sunday, 21 May 2017 at 08:44:31 UTC, David Zhang wrote:
Hi,
I was reading a bit about this in Rust, and their enum type. I
was wondering if this is replicate-able in D. What I've got
right now is rather clunky, and involves using
`typeof(return).ok` and `typeof(return).error)`.
On Sunday, 21 May 2017 at 09:29:40 UTC, David Zhang wrote:
On Sunday, 21 May 2017 at 09:15:56 UTC, Nicholas Wilson wrote:
have free functions
Result!(T, ErrorEnum) ok(T)(T t) { return Result(t); }
Result!(T, ErrorEnum) error(T)(ErrorEnum e) { return
Result(e); }
then go
if (!foo)
On Sunday, 21 May 2017 at 09:55:41 UTC, David Zhang wrote:
On Sunday, 21 May 2017 at 09:37:46 UTC, Nicholas Wilson wrote:
On Sunday, 21 May 2017 at 09:29:40 UTC, David Zhang wrote:
Well then it becomes
Result!(T, E) ok(T,E) (T t) { return Result(t); }
Result!(T, E) error(T,E)(E e) {
On Monday, 29 May 2017 at 12:23:59 UTC, Suliman wrote:
I am doing REST interface with vibed. And thinking about
handling errors, if users forgot to pass all expected args in
function.
For example:
foo(int x, int y) // get request
{
}
/api/foo?x=111
And if user is forgot to pass `y` we will
On Thursday, 25 May 2017 at 08:34:54 UTC, JN wrote:
One of my favourite language features of Dart (other one being
factory constructors) are auto-assign constructors, for example
(writing it in pseudo-D):
class Person
{
string name;
int age;
this(this.age, this.name);
}
would translate
On Thursday, 18 May 2017 at 20:20:47 UTC, Gary Willoughby wrote:
This might be a really silly question but:
I've allocated some memory like this (Foo is a struct):
this._data = cast(Foo*) calloc(n, Foo.sizeof);
How can I then later check that there is a valid Foo at
`this._data` or
On Monday, 29 May 2017 at 23:39:17 UTC, Russel Winder wrote:
C++ allows one to create types that are pointer types but wrap
a primitive pointer to give RAII handling of resources. For
example:
[...]
std.stdio.File does basically the same thing with C's FILE*
On Tuesday, 30 May 2017 at 10:20:53 UTC, Andrew Edwards wrote:
Sorry, rough day. Could someone please explain what this means
and how do go about resolving it?
Thanks,
Andrew
If you want to resolve it just do
const label_size = CalcTextSize(...);
but as others have mentioned make sure
On Saturday, 3 June 2017 at 13:17:46 UTC, Russel Winder wrote:
A stripped down problem to avoid fluff. The C macro:
#define FLOB(t) (sizeof(t))
Can be used in another macro:
#define THINGY(a, b) (_THING(a, FLOB(b)))
We can use this as in:
THINGY(10, __u32)
Now the D Way says
On Thursday, 1 June 2017 at 12:04:05 UTC, Daniel Tan Fook Hao
wrote:
Somehow this code works for me:
```D
auto error (int status, string description){
struct Error {
int status;
string description;
}
Error err = {
status,
description
};
return
On Sunday, 4 June 2017 at 12:24:44 UTC, Suliman wrote:
// Will reuse the array, overwriting existing data.
// If other parts of the program are using existing data
// in the array, this will lead to hard-to-track-down bugs.
mytracks.length = 0;
mytracks.assumeSafeAppend();
Could you give an
On Wednesday, 7 June 2017 at 12:39:07 UTC, Russel Winder wrote:
Are there any idiom rules as to where to put import statements
in D?
In Python they can go anywhere but PEP-8 suggests they should
all go at the top of a file, just after the module
documentation string.
Well for ones that
On Saturday, 10 June 2017 at 12:44:07 UTC, Honey wrote:
On Saturday, 10 June 2017 at 12:23:05 UTC, Nicholas Wilson
wrote:
On Saturday, 10 June 2017 at 12:16:34 UTC, Honey wrote:
Is it expected that turning off bounds checking can lead to a
performance decrease?
Yes, with it on you are doing
On Saturday, 10 June 2017 at 14:14:53 UTC, Steven Schveighoffer
wrote:
I can confirm on my system, ldc with bounds check off was at
least twice as slow as with just -release.
Definitely seems like a bug
-Steve
Ya, see https://github.com/ldc-developers/ldc/issues/2161
On Saturday, 10 June 2017 at 12:16:34 UTC, Honey wrote:
On Saturday, 10 June 2017 at 11:53:44 UTC, Johan Engelen wrote:
`-release` should be synonymous with `-release
-boundscheck=off`.
Nope it's not.
On Monday, 1 May 2017 at 12:42:01 UTC, Alex wrote:
Hi all,
the last foreach in the following code does not compile... Is
this a bug, or is something wrong with my syntax?
void main()
{
import std.parallelism : parallel;
import std.range : iota;
foreach(i;
On Sunday, 21 May 2017 at 19:33:06 UTC, ParticlePeter wrote:
I am statically linking to ImGui [1] on Win 10 x64, quite
successfully till this issue came up. The noticed error so far
comes when an ImGui function returns an ImVec2, a simple POD
struct of two float members. I can use this struct
On Monday, 5 June 2017 at 18:22:31 UTC, Sebastien Alaiwan wrote:
On Wednesday, 22 March 2017 at 13:42:21 UTC, Matthias Klumpp
wrote:
This is why most of my work in Meson to get D supported is
adding weird hacks to translate compiler flags between GNU <->
non-GNU <-> DMD. It sucks quite badly,
On Tuesday, 27 June 2017 at 09:54:19 UTC, John Burton wrote:
I'm coming from a C++ background so I'm not too used to garbage
collection and it's implications. I have a function that
creates a std.socket.Socket using new and connects to a tcp
server, and writes some stuff to it. I then
On Tuesday, 27 June 2017 at 11:43:27 UTC, John Burton wrote:
On Tuesday, 27 June 2017 at 10:14:16 UTC, Jonathan M Davis
wrote:
On Tuesday, June 27, 2017 09:54:19 John Burton via
Digitalmars-d-learn wrote:
I'm coming from a C++ background so I'm not too used to
garbage collection and it's
On Tuesday, 12 September 2017 at 03:51:45 UTC, Laeeth Isharc
wrote:
Hi.
I'm here in HK with Ilya, Atila, John Colvin, and Jonathan
Davis.
I wondered what the current state of D catching C++ exceptions
was on Linux and Windows. I know that some work was done on
making this possible, and my
On Tuesday, 12 September 2017 at 01:13:29 UTC, Hasen Judy wrote:
Is this is a common beginner issue? I remember using an earlier
version of D some long time ago and I don't remember seeing
this concept.
Now, a lot of library functions seem to expect ranges as inputs
and return ranges as
On Saturday, 16 September 2017 at 21:45:34 UTC, Nordlöw wrote:
How do I temporarily enable -vgc when building my app with DUB?
I've tried
DFLAGS=-vgc /usr/bin/dub build --build=unittest
but it doesn't seem to have any effect as it doesn't rebuild
directly after the call
/usr/bin/dub build
On Tuesday, 19 September 2017 at 11:47:00 UTC, Timothy Foster
wrote:
I'm trying to compile my project as a Win64 application but
this is happening:
Building C:\Users\me\test\test.exe...
OPTLINK (R) for Win32 Release 8.00.17
Copyright (C) Digital Mars 1989-2013 All rights reserved.
On Friday, 22 September 2017 at 04:37:44 UTC, Enjoys Math wrote:
On Friday, 22 September 2017 at 04:25:00 UTC, Enjoys Math wrote:
I've tried opening the port for TCP with windows 10 firewall
settings. Same result.
What tool would best help me debug this? Wireshark or is that
too low level?
On Saturday, 23 September 2017 at 09:37:54 UTC, rikki cattermole
wrote:
On 23/09/2017 10:34 AM, Guillaume Piolat wrote:
On Saturday, 23 September 2017 at 03:16:30 UTC, rikki
cattermole wrote:
Alternatively you can alter the package that dub already
knows about.
Does the trick more easily ;)
On Saturday, 23 September 2017 at 08:45:00 UTC, Mengu wrote:
hello everyone
i have a small program that parses an xml file, holding a list
with 13610 elements. after making the list, it iterates over
the list (paralele), goes to a web site and grabs the related
data for that element.
it
On Saturday, 23 September 2017 at 11:23:26 UTC, Nicholas Wilson
wrote:
Only other thing I can suggest is try linking against a debug
phobos to see if you can get some more diagnostics.
You might also try LDC's -fsanitize=address option for catching
memory bugs.
On Saturday, 23 September 2017 at 11:58:40 UTC, Mengu wrote:
hi all
i've successfully compiled phobos master with gmake on freebsd.
(make fails, i've no clue at all as to why)
how do i compile my project now against my local phobos with
dub? with plain dmd?
i tried (in dub.sdl):
- full
I want to use a fork of one of my dub dependencies so I can make
sure that it works before I merge the fork into upstream.
http://code.dlang.org/advanced_usage
says
Path-based dependencies
Package descriptions in the dub.json/dub.sdl can specify a
path instead of a version; this can
On Saturday, 23 September 2017 at 04:45:47 UTC, Mike Parker wrote:
On Saturday, 23 September 2017 at 03:13:15 UTC, Nicholas Wilson
wrote:
my dub.selections.json is currently:
{
"fileVersion": 1,
"versions": {
"derelict-cl": "2.0.0",
On Sunday, 17 September 2017 at 11:42:16 UTC, kerdemdemir wrote:
Hi,
Thanks its price dropped to 10 Euros I bought the the D Web
Development book and I were trying to build some examples.
The example in Chapter3 called noteapp4 is giving me this error
:
[...]
Optlink bug I guess?
try
On Friday, 6 October 2017 at 18:12:43 UTC, kerdemdemir wrote:
Hi,
I have a cuda kernel already working in my cpp
project(https://github.com/kerdemdemir/CUDABeamformer/blob/master/CudaBeamformer/kernel.cu)
I am trying to convert this to D with using DCompute. I already
compiled the DCompute
On Saturday, 7 October 2017 at 10:34:15 UTC, kerdemdemir wrote:
do you set "-mdcompute-targets=cuda-xxx" in the dflags for
your dub.json for your project?
I have added now after your comment.
But it seems it didn't changed anything.
Here is the dub.json file I have:
{
"name":
On Tuesday, 17 October 2017 at 06:38:52 UTC, Biotronic wrote:
If I understand things correctly, you only care about enums
nested in scopes up to the module scope, right? If so, this
seems to fit the bill:
enum A {a}
struct S {
enum B {b}
struct S2 {
enum C {c}
C c;
using fullyQualifiedName [here]
(https://github.com/libmir/dcompute/blob/master/source/dcompute/driver/ocl/util.d#L120)
leads to a large compilation slowdown, but I only need it to
disambiguate up to the module level i.e. so that
struct Context
{
enum Properties {}
static struct Info
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
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,);
return ret;
}
mixin generateInfo!getMyTypeInfo;
}
I want a module level initialised delegate. if I try
module foo;
enum Status
{
success,
}
class StatusException : Exception
{
Status s;
// usual exception constructors
}
void delegate(Status) onError = (Status s) { throw new
StatusException(s);};
I get a error like cannot
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, 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
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!
struct ArrayAccesssor(alias ptr, alias len) {}
char * p;
size_t len;
ArrayAccesssor!(p,len) aa;
template helper(Fields...)
{
static if (Fields.length == 0)
enum helper = "";
else static if (is(typeof(Fields[0]) :
ArrayAccesssor!(ptr,len),ptr, len)) //13
{
On Sunday, 1 October 2017 at 07:21:57 UTC, ag0aep6g wrote:
else static if (is(typeof(Fields[0]) : ArrayAccesssor!(ptr,len),
alias ptr, alias len))
Ah, so close. Thanks!
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,
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 Wednesday, 27 September 2017 at 11:59:16 UTC, Arav Ka wrote:
GCC supports a `__attribute((section("...")))` for variables to
put them in specific sections in the final assembly. Is there
any way this can be achieved in D? Does GDC support this?
GDC should
On Saturday, 26 August 2017 at 00:27:47 UTC, Ali Çehreli wrote:
I think you need a variation of intermediateCallback() below. I
passed the address of the delegate as userData but you can
construct any context that contains everything that you need
(e.g. the address of ms).
import std.stdio;
On Friday, 25 August 2017 at 13:49:20 UTC, Kagamin wrote:
You're not specific enough. What would be semantics of such
wrapper?
The C function I'm trying to wrap takes a function pointer which
is essentially a delegate, but not quite:
ErrorEnum function(Struct* s, void function(Struct*,
I want to wrap:
ErrorEnum function(Struct* s, void function(Struct*, ErrorEnum
status, void *userData) callback, void *userData, uint flags);
as a member of a wrapping struct
struct Mystruct
{
Struct* s; // wrapped
ErrorEnum addCallback(void delegate(Struct*, ErrorEnum
status))
On Saturday, 19 August 2017 at 10:16:18 UTC, Balagopal Komarath
wrote:
Let us say I want to automatically define subtraction given
that addition and negation are defined. I tried the following
using mixin templates. If I simply mixin the template using
"mixin sub;", then it gives the error
On Friday, 1 September 2017 at 11:33:15 UTC, Biotronic wrote:
On Friday, 1 September 2017 at 10:15:09 UTC, Nicholas Wilson
wrote:
So I have the following types
struct DevicePointer(T) { T* ptr; }
struct Buffer(T)
{
void* driverObject;
T[] hostMemory;
}
and a function
auto
On Friday, 1 September 2017 at 10:58:51 UTC, user1234 wrote:
On Friday, 1 September 2017 at 10:15:09 UTC, Nicholas Wilson
wrote:
So I have the following types
...
i.e. it substitutes the template DevicePointer for the
template Buffer in Parameters!foo,
The templates can be assumed to not be
On Monday, 4 September 2017 at 05:45:18 UTC, Vino.B wrote:
On Saturday, 2 September 2017 at 20:54:03 UTC, Vino.B wrote:
On Saturday, 2 September 2017 at 20:10:58 UTC, Moritz Maxeiner
wrote:
On Saturday, 2 September 2017 at 18:59:30 UTC, Vino.B wrote:
[...]
Cannot reproduce under Linux with
On Monday, 4 September 2017 at 20:39:11 UTC, Igor wrote:
I found that I can't use __simd function from core.simd under
LDC
Correct LDC does not support the core.simd interface.
and that it has ldc.simd but I couldn't find how to implement
equivalent to this with it:
ubyte16* masks = ...;
On Friday, 1 September 2017 at 11:33:15 UTC, Biotronic wrote:
On Friday, 1 September 2017 at 10:15:09 UTC, Nicholas Wilson
wrote:
So I have the following types
struct DevicePointer(T) { T* ptr; }
struct Buffer(T)
{
void* driverObject;
T[] hostMemory;
}
and a function
auto
On Friday, 1 September 2017 at 22:10:43 UTC, Biotronic wrote:
On Friday, 1 September 2017 at 19:39:14 UTC, EntangledQuanta
wrote:
Is there a way to create a 24-bit int? One that for all
practical purposes acts as such? This is for 24-bit stuff like
audio. It would respect endianness, allow for
On Saturday, 2 September 2017 at 10:15:04 UTC, Vino.B wrote:
Hi All,
Can you please guide me how can i use array appender for the
below piece of code
string[][] cleanFiles (string FFs, string Step) {
auto dFiles = dirEntries(FFs, SpanMode.shallow).filter!(a =>
a.isFile).map!(a =>
On Saturday, 2 September 2017 at 21:11:17 UTC, Vino.B wrote:
On Saturday, 2 September 2017 at 15:47:31 UTC, Vino.B wrote:
On Saturday, 2 September 2017 at 12:54:48 UTC, Nicholas Wilson
wrote:
[...]
Hi,
[...]
Hi,
Was able to resolve the above issue, but again getting the
same for other
On Friday, 1 September 2017 at 09:38:59 UTC, Alex wrote:
Hi all!
Say, I have
struct A(T...)
{
T arr;
}
struct B(T...)
{
T[] arr;
}
void main()
{
A!(int[], double[]) a;
a.arr[0] ~= 5;
a.arr[0] ~= 6;
static assert(!__traits(compiles, a.arr[0] ~=
So I have the following types
struct DevicePointer(T) { T* ptr; }
struct Buffer(T)
{
void* driverObject;
T[] hostMemory;
}
and a function
auto enqueue(alias k)(HostArgsOf!k) { ... }
where k would be a function like
void foo( DevicePointer!float a, float b , int c) { ... }
How can I
My project is a library, but I also need to test it and unit
tests won't cut it (external hardware).
How do you set up the dub.json to build the library normally but
when it is invoked with `dub test` it runs a separate
configuration that also includes files in the `source/test`
folder, but
On Saturday, 7 October 2017 at 09:04:26 UTC, kerdemdemir wrote:
You should add DCompute as a DUB dependancy.
Hi,
I inited my project with Dub by unsing "dub init DSharpEar"
and I added dependency "dcompute".
Even I give extra parameters for using ldc.
dub build
On Wednesday, 27 September 2017 at 09:00:55 UTC, Ky-Anh Huynh
wrote:
Hi,
Can I have a `break` option when using `dirEntries()` (similar
to `break` in a loop)? I want to study sub-directories but if
any sub-directory matches my criteria I don't to look further
into their subdirectories
```
On Monday, 23 October 2017 at 12:41:09 UTC, Márcio Martins wrote:
What is everyone doing to get proper file name and line number
info for callstacks with DMD?
addr2line just gives me ??:0
What OS, etc?
On Friday, 10 November 2017 at 09:33:17 UTC, Nordlöw wrote:
What kinds of intrinsics are explicitly available to the
developer when compiling with LDC?
And are there any docs?
there are some pragmas for bitop stuff.
https://github.com/ldc-developers/ldc/blob/master/gen/pragma.cpp#L59
there
On Friday, 10 November 2017 at 08:30:39 UTC, OlaOst wrote:
Using 'dub --arch=x86_64' will get you a 64 bit build, but is
it possible to specify 64 bit architecture in the configuration
file, so one can just type 'dub' and get a 64 bit build?
"dflags" : "-m64"
will work. You can probably use
On Tuesday, 14 November 2017 at 04:31:43 UTC, Laeeth Isharc wrote:
He mentions D, a bit dismissively.
http://esr.ibiblio.org/?p=7724=1#comment-1912717
I think that the date he mentions in that paragraph (2001) speaks
a lot for his argument, i.e. completely outdated.
On Thursday, 23 November 2017 at 05:19:27 UTC, Andrey wrote:
Hello, is there way to reduce this condition:
if (c1) {
foo();
} else {
if (c2) {
bar();
} else {
if (c3) {
...
}
}
}
for instance in kotlin it can be replace with this:
when {
c1
On Wednesday, 22 November 2017 at 15:07:08 UTC, Tim Hsu wrote:
I am a C++ game developer and I want to give it a try.
It seems "this" in Dlang is a reference instead of pointer.
How can I pass it as void *?
void foo(void *);
class Pizza {
public:
this() {
Pizza newone = this;
On Wednesday, 22 November 2017 at 16:57:10 UTC, Joakim wrote:
On Wednesday, 22 November 2017 at 15:10:40 UTC, Oleg B wrote:
[...]
betterC is a new feature that's still being worked on and still
has holes in it:
https://github.com/dlang/dmd/pull/7151
I suggest you open an issue for it on
On Wednesday, 29 November 2017 at 06:34:53 UTC, Fat_Umpalumpa
wrote:
Hello, I have searched these forums a bit to see if it is
possible to use python libraries such as matplotlib which I
have enough experience with, and wish to continue using this
wonderful library within D. Maybe there are
On Tuesday, 12 December 2017 at 17:32:15 UTC, Frank Like wrote:
Hi,everyone,
who can help me,about the "AssocArray to string is ok,but how
to get the AssocArray from string? ".
For example:
SysTime[][string] AATimes;
AATimes["a1"] =[SysTime(DateTime(2017, 1, 1, 12, 33,
301 - 400 of 606 matches
Mail list logo