On Friday, 6 February 2015 at 17:09:29 UTC, Charles wrote:
I'm trying to create a template function that can take in any
type of array and convert it to a ubyte array. I'm not
concerned with endianness at the moment, but I ran into a
roadblock when trying to do this with strings. It already
On Thursday, 5 February 2015 at 13:31:21 UTC, Nicholas Wilson
wrote:
On Thursday, 5 February 2015 at 12:31:31 UTC, Stéphane wrote:
Syntax for checking if an element exists in a list
Hello,
I would like to know if there is a better (easier to wite,
easier to read, easier to understand) way
On Thursday, 5 February 2015 at 12:31:31 UTC, Stéphane wrote:
Syntax for checking if an element exists in a list
Hello,
I would like to know if there is a better (easier to wite,
easier to read, easier to understand) way to check if an element
(string) is
in a list of strings.
Here are
The original code I was using was written in Java, and only had
a method for strings. This is closer to what I wanted. My unit
tests were just going back and forth with readString function,
so I was completely missing this for other types. Nice catch!
There were a couple issues with your
On Friday, 20 February 2015 at 03:26:47 UTC, Gan wrote:
Also I can't get my application to load images that I place in
the Resources folder(or any folder in the bundle for that
matter).
I suggest to have a look at the projects generated by SFML
regarding locating the resources in C++/ObjC and
On Wednesday, 28 January 2015 at 11:50:46 UTC, Danny wrote:
Hello,
I'm trying to write some toy examples using threads in D.
Is the std.stdio.File thread-local or shared? Is flockfile used
when I synchronize on it?
I tried checking phobos myself and found some things I don't
get (in
I think I have to set length first.
Yes.
Declaring
BitArray b;
is like declaring
int[] a; // ={.length = 0, . ptr = null}
you get the segfault for invalid dereference.
On Monday, 26 January 2015 at 11:15:26 UTC, Joakim wrote:
Right now, any attempt to have symbols with the same name
errors out, regardless of how they're used. This caused a
problem for me because I'm trying to use a third-party C
library that defines a struct type called socket and my code
On Saturday, 31 January 2015 at 14:12:59 UTC, Phil wrote:
When trying to run my program with profiling enabled it dies
before the first line of my main function runs. Everything
works fine without profiling. I get the following stack trace:
thread #1: tid = 0x38de4, 0x00010008d985
On Monday, 9 February 2015 at 19:30:32 UTC, Benjamin Thaut wrote:
When binding C++ value types you might want to use them by
placing them on the D-Stack. This however seems to be not
supported as the mangling for the constructor is completely
wrong. Is this supposed to work?
Kind Regards
On Saturday, 28 February 2015 at 06:45:58 UTC, Mike Parker wrote:
I'm not a Mac user and I'm fairly clueless about it. The DMD
zip for OS X contains one executable. I assume it's a 64-bit
binary. Is that true?
Most likely a disk image (.dmg).
(en.wikipedia.org/wiki/Apple_Disk_Image)
On Friday, 20 February 2015 at 06:19:29 UTC, Gan wrote:
On Friday, 20 February 2015 at 06:10:51 UTC, Nicholas Wilson
wrote:
On Friday, 20 February 2015 at 03:26:47 UTC, Gan wrote:
Also I can't get my application to load images that I place
in the Resources folder(or any folder in the bundle
On Thursday, 2 April 2015 at 23:12:25 UTC, biozic wrote:
The code below doesn't compile. Why this error message?
---
struct Item {
int i;
}
struct Params {
Item* item;
this(int i) {
item = new Item(i); // line 9
}
}
struct Foo(Params params) {}
enum foo =
On Sunday, 7 June 2015 at 12:30:12 UTC, Dennis Ritchie wrote:
Does D the ability to add items to arrays and hashes at compile
time?
For example, how do I do it in compile time?:
int[][int][int] hash;
hash[4][6] ~= [34, 65];
hash[5][7] ~= [4, 78, 21];
try using a pure function + static e.g.
On Saturday, 27 June 2015 at 12:27:59 UTC, H. S. Teoh wrote:
On Sat, Jun 27, 2015 at 12:22:06PM +, Nicholas Wilson via
Digitalmars-d-learn wrote:
How do I iterate through an AA sorted by key?
I am unable to .dup the aa.byKeyValue().
Because it is a range, not an array.
To turn
How do I iterate through an AA sorted by key?
I am unable to .dup the aa.byKeyValue().
I have tried both
foreach(e; aa.byKeyValue().sort!a.key b.key)
{
//... use e. key e.value
}
and
foreach(k,v; aa.byKeyValue().sort!a.key b.key)
{
}
i get :
template std.algorithm.sorting.sort cannot
On Sunday, 7 June 2015 at 00:38:17 UTC, Jonathan Villa wrote:
module dt2.DataBlock;
class DataBlock
{
public DataBlock * NextBlock;
public DataBlock * PrevBlock;
public string value;
this()
{
NextBlock = null;
PrevBlock =
On Wednesday, 1 July 2015 at 08:33:44 UTC, Yuxuan Shui wrote:
On Wednesday, 1 July 2015 at 08:30:23 UTC, Yuxuan Shui wrote:
How do I express a mutable reference to a const object in D?
What I want to do is to define a variable, which refers a
constant object, but I can change which constant
So test.d depends on libgmp.a
Unsurprisingly:
$dmd test.d
fails to find libgmp.a
So tell it to look
$dmd -L-lgmp test.d
finds the wrong one or doesn't find it.
Tell it where to look
$dmd -L-L/usr/local/lib -L-lgmp test.d
Ok. Now it fails to find Phobos. Ok
$dmd -L-L/usr/local/lib
On Thursday, 2 July 2015 at 12:19:06 UTC, Steven Schveighoffer
wrote:
On 7/2/15 8:10 AM, Nicholas Wilson wrote:
[...]
Try dmd -v, it will tell you the link line. Then you can try it
yourself to see how to get it to work. I know dmd has problems
with link line parameters, because it always
On Thursday, 2 July 2015 at 03:07:43 UTC, Matthew Gamble wrote:
I am trying to make the transition from C++ to D. I've hit a
snag with the etc.c.zlib module where any attempt to use this
module to open a file yields an error:
Error 42: Symbol Undefined __lseeki64.
Here is a simple example of
On Friday, 3 July 2015 at 23:45:15 UTC, Guy Gervais wrote:
On Friday, 3 July 2015 at 19:17:28 UTC, Marko Grdinic wrote:
Any advice regarding how I can get this to work? Thanks.
I got GDC to work with VS2013 + VisualD by going into
Tools-Options (The VS menu, not the one under Visual D)
and
On Monday, 29 June 2015 at 22:05:47 UTC, qznc wrote:
I stumbled upon this interesting programming challenge [0],
which imho should be possible to implement in D. Maybe someone
here wants to try.
Task: Given two enums with less than 256 states, pack them into
one byte and provide convenient
On Monday, 6 July 2015 at 03:02:59 UTC, Nicholas Wilson wrote:
On Monday, 6 July 2015 at 01:16:54 UTC, Peter wrote:
Hi,
I have a struct with arithmetic operations defined using
opBinary but array operations with arrays of it don't work.
struct Vector3 {
public double[3] _p;
...
On Monday, 6 July 2015 at 01:16:54 UTC, Peter wrote:
Hi,
I have a struct with arithmetic operations defined using
opBinary but array operations with arrays of it don't work.
struct Vector3 {
public double[3] _p;
...
Vector3 opBinary(string op)(in Vector3 rhs) const
if (op ==
On Thursday, 13 August 2015 at 08:40:13 UTC, ted wrote:
have upgraded from 2.066.1 to 2.068.0, and have a change in
behaviour:
import std.container: SList;
void main()
{
SList!int tmp;
tmp.insertAfter( tmp[], 3 );
}
used to work happily with dmd2.066.1, causes assert
On Wednesday, 19 August 2015 at 09:54:33 UTC, SimonN wrote:
Hi,
in a release-like build, I'm using the tharsis profiler, which
is a
frame-based profiler. Zone is a RAII struct that measures how
long its own
lifetime is.
with (Zone(my_profiler, zone name to appear in output)) {
On Thursday, 20 August 2015 at 20:01:58 UTC, tony288 wrote:
On Thursday, 20 August 2015 at 15:37:35 UTC, Dejan Lekic wrote:
[...]
Thanks, I changed the code and the previous one was already
using shared.
import std.stdio;
import core.time;
import core.thread;
[...]
Keep in mind java may
On Sunday, 16 August 2015 at 17:33:52 UTC, Benjamin wrote:
I'm having an issue with building my app - even a simple
trivial app (shown below).
[...]
OS X version?
Have you configured your dmd.conf? iirc it requires linker path
changes or something.
Have you looked in /usr/local/lib for
On Sunday, 16 August 2015 at 23:40:41 UTC, Brandon Ragland wrote:
On Sunday, 16 August 2015 at 23:31:46 UTC, Ali Çehreli wrote:
On 08/16/2015 04:13 PM, Brandon Ragland wrote:
That makes more sense. Though it does make the ref method
signature unclear, as it only applies to literals at this
On Monday, 17 August 2015 at 02:45:22 UTC, Brandon Ragland wrote:
Howdy,
Since Dynamic Arrays / Slices are a D feature, using pointers
to these has me a bit confused...
Consider:
Now what is especially confusing about this, is that the above
seems to works fine, while this does not:
On Friday, 7 August 2015 at 11:45:22 UTC, Nordlöw wrote:
To implement a new trait
isSortedRange(R, pred)
needed for SortedRange specializations I need a variant of
enum bool isInstanceOf(alias S, T) = is(T == S!Args,
Args...);
that takes the `pred` argument aswell.
But I have no
On Sunday, 9 August 2015 at 01:29:16 UTC, Christopher Davies
wrote:
I'm just learning D. Something I often do in C# is have an
IEnumerable (Range) of some type that is then conditionally
filtered. It looks like this:
IEnumerableDictionarystring, string foo = bar;
if (baz)
{
foo =
On Friday, 17 July 2015 at 12:18:56 UTC, TC wrote:
Hello,
I came around a strange behavior and I'm not sure if it is a
bug or feature.
import std.typecons : Nullable;
struct Foo
{
string bar;
Nullable!int baz;
}
auto a = Foo(bb);
auto b = Foo(bb);
assert(a == b);
This ends
On Saturday, 18 July 2015 at 13:48:20 UTC, Clayton wrote:
Am new to D programming, am considering it since it supports
compile-time function execution . My challenge is how can I
re-implement the function below so that it is fully executed in
compile-time. The function should result to tabel1
On Monday, 20 July 2015 at 14:59:21 UTC, John Colvin wrote:
On Monday, 20 July 2015 at 14:40:59 UTC, jmh530 wrote:
[...]
Everything is exactly as I would expect. Lambdas with = are
just shorthand that skips the return expression and
std.algorithm.each just calls the lambda for each element
On Wednesday, 11 November 2015 at 05:03:47 UTC, BBaz wrote:
quoted from the website:
Sets the base name of the output file; type and platform
specific pre- and suffixes are added automatically
- this setting does not support platform suffixes
I must be blind but I can't find the code that
On Saturday, 7 November 2015 at 15:04:41 UTC, maik klein wrote:
template IsSame(T){
template As(alias t){
enum As = is(T : typeof(t));
}
}
void main()
{
int i;
enum b = IsSame!int.As!(i);
}
Err:
Error: template instance As!(i) cannot use local 'i' as
parameter to non-global
On Saturday, 14 November 2015 at 13:33:49 UTC, Fer22f wrote:
Hello! I'm starting to make some simple command line programs
and one thing I miss from C is a function for getting one
character from the input. This is for example, an "Press Any
Key Program".
Anyone that has more experience can
On Saturday, 14 November 2015 at 05:44:44 UTC, Anonymous wrote:
I was playing with some code someone posted on the forum that
involved opDispatch and compile time parameters. I pasted it in
a file named templOpDispatch.d, ran it, and got an error. Then
I noticed if I renamed the file it
On Saturday, 14 November 2015 at 12:14:42 UTC, Handyman wrote:
The D docs seem very thorough and complete to me but less
accessible in comparison to, e.g., Perl docs, Php docs, or Ruby
docs. In particular I have difficulties in understanding the
headers of the standard library function
On Monday, 2 November 2015 at 01:02:45 UTC, AnoHito wrote:
Hi, I am trying to write a simple interface to the MRuby Ruby
interpreter so I can use ruby scripts in my D program. I was
able to get MRuby compiled as a DLL without too much
difficulty, but the headers are very long and complicated,
On Saturday, 7 November 2015 at 03:19:44 UTC, Charles wrote:
Hi guys,
It's me again... still having some issues pop up getting
started, but I remain hopeful I'll stop needing to ask so many
questions soon.
I'm trying to use std.bitmanip.read; however, am having some
issues using it. For
On Tuesday, 3 November 2015 at 23:29:45 UTC, TheFlyingFiddle
wrote:
Is there a built in way to do this in dmd?
Basically I want to do this:
auto decode(T)(...)
{
while(...)
{
T t = T.init; //I want this aligned to 64 bytes.
}
}
Currently I am using:
align(64) struct
On Tuesday, 3 November 2015 at 23:16:59 UTC, bertg wrote:
I am having trouble with a simple use of concurrency.
Running the following code I get 3 different tid's, multiple
"sock in" messages printed, but no receives. I am supposed to
get a "received!" for each "sock in", but I am getting
On Thursday, 8 October 2015 at 09:29:30 UTC, tcak wrote:
I am "trying" to write a function that takes an array of items,
and returns the length of longest item.
[code]
size_t maxLength(A)( const A[] listOfString ) if( __traits(
hasMember, A, "length" ) )
{
return 0; // not
On Monday, 5 October 2015 at 11:31:32 UTC, Radu wrote:
There is a weird rule on how compiler treats alias this for the
N and S types bellow.
[...]
Please file a bug report.
Also do the errors change if you reverse the order in T i.e.
alias T = Algebraic!(S,N); ?
On Monday, 7 September 2015 at 08:55:31 UTC, Fra wrote:
I encountered a runtime error in my code and all I can get
(even in debug mode) is the following stacktrace:
object.Error@(0): Access Violation
0x0051C308 in const(nothrow @trusted uint
function(const(void*)))
On Saturday, 12 September 2015 at 20:05:28 UTC, rcorre wrote:
After upgrading from DMD 2.068.0-1 to DMD 2.068.1-1, my project
began producing a large linker error (when built using dub).
I was able to trace it down to a single line:
target =
On Tuesday, 29 September 2015 at 06:08:03 UTC, Cauterite wrote:
On Tuesday, 29 September 2015 at 03:31:44 UTC, Nicholas Wilson
wrote:
so I have a bunch of enums (0 .. n) that i also want to
represent as flags ( 1 << n foreach n ). Is there anyway to do
this other than a string mixin?
You
so I have a bunch of enums (0 .. n) that i also want to represent
as flags ( 1 << n foreach n ). Is there anyway to do this other
than a string mixin?
use like:
enum blah
{
foo,
bar,
baz,
}
alias blahFlags = EnumToFlags!blah;
static assert(blahFlags.baz == 1 << blah.baz)
On Tuesday, 29 September 2015 at 09:18:52 UTC, John Colvin wrote:
On Tuesday, 29 September 2015 at 03:31:44 UTC, Nicholas Wilson
wrote:
so I have a bunch of enums (0 .. n) that i also want to
represent as flags ( 1 << n foreach n ). Is there anyway to do
this other than a string mixin?
use
On Thursday, 24 September 2015 at 11:26:12 UTC, Marc Schütz wrote:
On Thursday, 24 September 2015 at 01:01:09 UTC, Nicholas Wilson
wrote:
On Wednesday, 23 September 2015 at 21:25:15 UTC, tcak wrote:
On Wednesday, 23 September 2015 at 21:14:17 UTC, Adam D.
Ruppe wrote:
[...]
Is there any way
On Wednesday, 23 September 2015 at 21:25:15 UTC, tcak wrote:
On Wednesday, 23 September 2015 at 21:14:17 UTC, Adam D. Ruppe
wrote:
On Wednesday, 23 September 2015 at 21:08:37 UTC, tcak wrote:
I wouldn't expect B's constructor to be called at all unless
"super" is used there.
"If no call to
On Friday, 25 September 2015 at 02:37:22 UTC, TheGag96 wrote:
So I'm just doing a small test program here:
http://pastebin.com/UYf2n6bP
(I'm making sure I know quicksort for my algorithms class, I
know functionally this won't work as-is)
I'm on Linux, 64-bit, DMD 2.068.1, and when I try to
On Friday, 25 September 2015 at 03:12:20 UTC, French Football
wrote:
...without having to loop over the enum?
enum SomeType : string { CHEESE = "cheese", POTATO = "potato" }
string valid_value = "cheese";
string invalid_value = "pizza";
bool test( string value ){
if(
On Friday, 25 September 2015 at 05:50:58 UTC, Charanjit Singh
wrote:
import std.stdio;
import std.math;
void main()
{
float sum,pi,t;
int n=1;
sum=0;
while (n<100 )
{
t=1/( n*n);
n=n+1;
sum=sum+t;
}
writeln("value of PI= " , (sum*6)^^.5);
that is pi
On Friday, 4 December 2015 at 13:24:16 UTC, ref2401 wrote:
Which type it better to use for array's indices?
float[] arr = new float[10];
int i;
long j;
size_t k;
// which one is better arr[i], a[j]or arr[k] ?
It seem like `size_t` suites well because 'is large enough to
represent an
On Thursday, 3 December 2015 at 13:36:16 UTC, Christian Köstlin
wrote:
Hi,
I started an experiment with the informations that are
available for compile time reflection.
[...]
I think CyberShadow (aka Vladimir Panteleev) has done something
similar to this
On Saturday, 12 December 2015 at 07:39:47 UTC, Suliman wrote:
if(a is null)
How to check if variable "is not null" ?
a !is null
or
!(a is null)
On Thursday, 17 December 2015 at 11:58:35 UTC, drug wrote:
On 17.12.2015 14:52, Andrea Fontana wrote:
You should publish some code to check...
Too much code to public - operations are simple, but there are
many branches and reducing may take much time . In fact I asked
to understand _in
On Wednesday, 6 January 2016 at 11:39:44 UTC, Voitech wrote:
Hello, i am new to D language and trying to learn it by coding.
I compile my programs on Xubuntu 14.04 with DMD64 D Compiler
v2.069.2.
So i have a struct/union which contains two fields representing
real and string values:
public
On Friday, 1 January 2016 at 00:41:56 UTC, brian wrote:
I have a large list, B, of string items. For each item in that
large list, I need to see if it is in the smaller list, A.
I have been using a simple string array for the storage of A
string[] A
and then using foreach to go through all
On Thursday, 17 December 2015 at 13:30:11 UTC, drug wrote:
On 17.12.2015 16:09, Nicholas Wilson wrote:
[...]
Thanks for answer. My C++ version is tracing D version so
commutativity and distributivity aren't requred because order
of operations is the same (I guess so at least), so I hoped for
On Thursday, 26 November 2015 at 17:27:34 UTC, André wrote:
Hi,
I have a maybe trivial question on how to insert or update a
given entry in a multidimensional AA. So I have this AA:
/// language, chapter, section. Content is a magic struct
Content[int][string][string] contentAA;
In
On Friday, 27 November 2015 at 07:48:15 UTC, Alexander wrote:
import std.stdio;
import derelict.opengl3.gl3;
import derelict.sdl2.sdl;
pragma(lib, "DerelictUtil.lib");
pragma(lib, "DerelictGL3.lib");
pragma(lib, "derelictSDL2.lib");
void main(){
DerelictGL3.load();
On Tuesday, 1 December 2015 at 04:10:55 UTC, Jonathan Villa wrote:
Hi,
I've been trying to create a NamedPipe with security attributes
but at compile time throws:
Error 42: Symbol Undefined _InitializeSecurityDescriptor@8
Error 42: Symbol Undefined _SetSecurityDescriptorDacl@16
What is
Is it legal/possible to overload the unary * operator? Also is it
legal/possible to individually overload the comparison operators
and not return a bool?
(Before you ask no I'm not crazy, I am trying to make a library
solution to multiple address spaces for supporting OpenCL/CUDA in
D, and
as in
@myattr
module foo;
not
module foo;
@myattr:
On Friday, 5 February 2016 at 10:54:27 UTC, Robert M. Münch wrote:
From the docs:
class A { }
class B : A { }
class C : B { }
void foo(A);
void foo(B);
[...]
sounds like foo should just be a method in the class rather than
a free function
On Sunday, 31 January 2016 at 21:22:06 UTC, SimonN wrote:
Hi,
we start with the following code snippet, which works.
import std.algorithm;
import std.range;
import std.stdio;
class A { int val; }
class B : A { this() { val = 3; } }
class C : A { this() { val = 4; }
On Wednesday, 3 February 2016 at 12:20:42 UTC, Vasileios
Anagnostopoulos wrote:
Is there any example,framework or tutorial on how to call D
from Tcl (write new commands in D for Tcl)?
I am on Windows 10 x86_64.
thank you.
I'm not sure about the specifics but if it can be done in C you
can
On Wednesday, 24 February 2016 at 10:33:56 UTC, Tanel Tagaväli
wrote:
Hello!
I've been making some progress on the native D audio front:
https://github.com/clinei/daud/tree/28ac042a16ae6785605a9a501b5f867c8f962055
It's a continuous waveform generator, currently outputting a
saw wave that
On Tuesday, 23 February 2016 at 09:16:08 UTC, Nicholas Wilson
wrote:
struct A
{
int blah;
}
class B
{
A* a;
this(A* _a)
{
writeln(_a)
a =_a;
}
}
class C : B
{
this(A* _a)
{
writeln(_a)
super(_a);
}
}
int main(string[] args)
{
A
struct A
{
int blah;
}
class B
{
A* a;
this(A* _a)
{
writeln(_a)
a =_a;
}
}
class C : B
{
this(A* _a)
{
writeln(_a)
super(_a);
}
}
int main(string[] args)
{
A a;
writeln();
C c = new C();
}
prints
7FFF56E787F8
On Tuesday, 23 February 2016 at 07:26:01 UTC, Ali Çehreli wrote:
On 02/22/2016 09:52 PM, Nicholas Wilson wrote:
How is this not a constant expression ?
auto ctodtypes =
[
"void" : "void",
"uint32_t" : "uint",
"uint64_t" : "ulong",
"int32_t" : "int",
"int64_t"
On Tuesday, 23 February 2016 at 07:43:37 UTC, Ali Çehreli wrote:
On 02/22/2016 11:38 PM, Nicholas Wilson wrote:
I've tried with both mutable and immutable a module scope.
Scope I want
is global (don't care about mutability)
Uncomment immutable if you want immutable and remove 'shared'
if
On Sunday, 21 February 2016 at 15:18:44 UTC, ZombineDev wrote:
On Sunday, 21 February 2016 at 12:52:33 UTC, Nicholas Wilson
wrote:
[...]
I'm glad to see more people looking to create a D binding from
vk.xml!
I was also working on this
On Tuesday, 23 February 2016 at 10:47:17 UTC, Rene Zwanenburg
wrote:
On Tuesday, 23 February 2016 at 09:16:08 UTC, Nicholas Wilson
wrote:
struct A
{
int blah;
}
class B
{
A* a;
this(A* _a)
{
writeln(_a)
a =_a;
}
}
class C : B
{
this(A* _a)
{
So the vulkan spec has a lot of stuff like
VkStructureType
sType
const void*
pNext
optional="true">VkBufferCreateFlags
flags
VkDeviceSize
foreach(m; __traits(allMembers, vulkan_input))
{
static if (m.endsWith("_T"))
{
foreach(m2; __traits(allMembers, vulkan_input))
{
static if (__traits(isStaticFunction,typeof(m2)))//
<- what here?
{
enum fn =
On Friday, 26 February 2016 at 04:21:15 UTC, BBasile wrote:
On Friday, 26 February 2016 at 04:19:29 UTC, BBasile wrote:
static if (__traits(isStaticFunction,typeof(m2)))
static if (__traits(isStaticFunction, __traits(getMember,
vulkan_input, m2
Sorry don't copy paste like this there's a
On Sunday, 28 February 2016 at 05:59:39 UTC, WhatMeWorry wrote:
If so, is there a way to do a global search of all projects in
DUB?
Aside downloading them all and loading them into an IDE, Ctrl+F
for keywords in the description.
For what purpose?
Learning?
Ctrl+F finds me
there is no __traits(isEnum, ...)
I've tried
foreach(m; __traits(allMembers, ...)
{
static if (__traits(compiles,EnumMembers!(m)))
static if (EnumMembers!(m).length)
static if(is(m== enum))
}
I can detect static functions with __traits(isStaticFunction, ...)
On Thursday, 25 February 2016 at 04:32:24 UTC, Adam D. Ruppe
wrote:
On Thursday, 25 February 2016 at 04:25:25 UTC, Nicholas Wilson
wrote:
foreach(m; __traits(allMembers, ...)
{
static if(is(m== enum))
}
That's close but not quite there... try
static if(is(typeof(__traits(getMember,
On Thursday, 25 February 2016 at 04:50:14 UTC, Nicholas Wilson
wrote:
On Thursday, 25 February 2016 at 04:32:24 UTC, Adam D. Ruppe
wrote:
On Thursday, 25 February 2016 at 04:25:25 UTC, Nicholas Wilson
wrote:
foreach(m; __traits(allMembers, ...)
{
static if(is(m== enum))
}
That's close
On Thursday, 25 February 2016 at 12:53:37 UTC, asdf wrote:
I'm trying to make a terminal input preprocessor with
alias/shortcuts and history.
import std.stdio;
void main() {
string line;
string[] history;
line = readln();
foreach(int i; 0..100) history = history + [""]; //
On Thursday, 25 February 2016 at 12:53:37 UTC, asdf wrote:
I'm trying to make a terminal input preprocessor with
alias/shortcuts and history.
import std.stdio;
void main() {
string line;
string[] history;
line = readln();
foreach(int i; 0..100) history = history + [""]; //
On Thursday, 25 February 2016 at 13:38:56 UTC, ag0aep6g wrote:
On 25.02.2016 14:33, Nicholas Wilson wrote:
Note that D has zero based array indexing
so assuming your array has 100 elements history[1..100]
is going one past the end of the array.
No, that's fine. `history[1..100]` gives you 99
On Thursday, 25 February 2016 at 13:24:09 UTC, asdf wrote:
On Thursday, 25 February 2016 at 13:06:10 UTC, cym13 wrote:
In D the binary operator "~" is used to concatenate both
strings (arrays of characters) and arrays. (also the ~=
operator is equivalent to lhs = lhs ~ rhs
Nic
Just a
On Thursday, 25 February 2016 at 13:16:43 UTC, Voitech wrote:
Hi, I have some code processing functions definition in compile
time, I want to override
them in some other class but not explicitly so created this
code:
template MixinFunction(alias attributes,alias returnType,alias
name,alias
On Thursday, 25 February 2016 at 08:40:00 UTC, nkgu wrote:
On Thursday, 25 February 2016 at 04:55:09 UTC, Nicholas Wilson
wrote:
oops should be
writeln(typeof(__traits(getMember, vulkan_input,
m)).stringof);
that compiles but still prints nothing
try
pragma(msg,
On Monday, 22 February 2016 at 07:00:42 UTC, Nicholas Wilson
wrote:
On Sunday, 21 February 2016 at 15:18:44 UTC, ZombineDev wrote:
[...]
Thanks for the tips. I used AA and just got it to compile! :)
:| :( but fails to link.
Undefined symbols for architecture x86_64:
struct A
{
const (void *) p;
}
struct B
{
Aa;
this(void * _p)
{
a.p = _p;
}
}
I cannot change the definition of A
how do I initialise b.a.p?
On Friday, 26 February 2016 at 02:48:35 UTC, cym13 wrote:
On Friday, 26 February 2016 at 02:32:44 UTC, Nicholas Wilson
wrote:
struct A
{
const (void *) p;
}
struct B
{
Aa;
this(void * _p)
{
a.p = _p;
}
}
I cannot change the definition of A
how do I initialise
On Thursday, 25 February 2016 at 20:53:12 UTC, Voitech wrote:
On Thursday, 25 February 2016 at 14:29:30 UTC, Nicholas Wilson
wrote:
On Thursday, 25 February 2016 at 13:16:43 UTC, Voitech wrote:
[...]
You can (see std.meta/(std.traits?) , with recursive
templates), but there is nothing
How is this not a constant expression ?
auto ctodtypes =
[
"void" : "void",
"uint32_t" : "uint",
"uint64_t" : "ulong",
"int32_t" : "int",
"int64_t" : "long",
"char" : "char",
"uint8_t" : "ubyte",
"size_t": "size_t",
"float" : "float"
On Friday, 19 February 2016 at 05:41:01 UTC, jmh530 wrote:
I'm trying to write a function that will adjust the parameters
of a function pointer.
I think the problem is that it defaults to a delegate not that it
cannot be one
does clarifying this to the compiler work
Like
alias fp1 = int
So I was going through the vulcan spec to try to create a better
D bindings for it. (pointer /len pairs to arrays adhering to D
naming conventions and prettying up the *Create functions
functions like vkResult *Create( arg ,, retptr) to a fancy
throw on misuse struct with constructors and that
On Friday, 12 February 2016 at 20:43:24 UTC, Taylor Hillegeist
wrote:
So I have this code and I have to add the element
.each!(a => a.each!("a"));
to the end in order for it to evaluate the range completely and
act like I expect it too. Is there a better thing to put in
the place of
.each!(a
1 - 100 of 606 matches
Mail list logo