On 05/03/2015 06:06 PM, Jonathan M Davis via Digitalmars-d-learn wrote:
On Sunday, May 03, 2015 15:21:15 Andrew Godfrey via
Digitalmars-d-learn wrote:
I really don't think that it's an issue in general, but if you
do want to
guarantee that nothing affects the capacity of your array, then
On Thursday, 30 April 2015 at 12:31:54 UTC, wobbles wrote:
On Thursday, 30 April 2015 at 03:00:36 UTC, zhmt wrote:
On Thursday, 30 April 2015 at 02:02:50 UTC, zhmt wrote:
dub build is running on centos7. It works well until today,
It becomes very slow suddenly. It will take minuties per
mono-d is running on centos7 with options below:
first:
{
name: ezsock,
targetType: executable,
description: A minimal D application.,
copyright: Copyright © 2015, zhmt,
authors: [zhmt],
mainSourceFile: source/app.d,
dependencies: {
On 2015-05-04 03:52:21 +, Rikki Cattermole said:
Have you looked at my book? https://leanpub.com/ctfe
No, thanks for the hint. You will have one more reader ;-)
--
Robert M. Münch
http://www.saphirion.com
smarter | better | faster
On 2015-05-03 23:28:00 +, anonymous said:
Here T would have to be a type. But you want to accept a string. So:
template startsNotWith(string s,char c){
enum startsNotWith = s.length == 0 || s[0] != c;
}
Hi, ok, just to better understand this (I have a C++ background (even
On 2015-05-03 23:28:00 +, anonymous said:
You need to turn T into a parameter, so that StaticFilter can set it.
(And it's really a string again, so I'm renaming to s.)
template startsNotWithp(string s)
{
enum startsNotWithp = startsNotWith!(s, 'p');
}
/* Shorthand syntax: enum
On Monday, 4 May 2015 at 11:22:16 UTC, Robert M. Münch wrote:
Hi, ok, just to better understand this (I have a C++ background
(even quite old)): When I want to use some functions I need to
specify the type? It's not possible to use T.length() which
would compile if T is a string? I thought
On 4/05/2015 11:15 p.m., Robert M. Münch wrote:
On 2015-05-04 03:52:21 +, Rikki Cattermole said:
Have you looked at my book? https://leanpub.com/ctfe
No, thanks for the hint. You will have one more reader ;-)
I'm currently live streaming, feel free to jump on and ask any questions!
On Monday, 4 May 2015 at 11:41:23 UTC, Robert M. Münch wrote:
Hi, I have one more questions: Is it possible to write
something like this?
alias rules = StaticFilter!(startsNotWith(?, 'p'), org_rules);
The ? should be used for every memember of org_rules.
No, we don't have template literals.
ketmar ket...@ketmar.no-ip.org writes:
On Sun, 03 May 2015 18:07:20 -0700, Dan Olson wrote:
It seems a private class or struct defaults to public members. Just
curious if this is intended. I would have expected private all the way
down unless overriden.
i bet it is intended. protection
Many thanks. Just to recap, I got the code working with:
glBufferData(GL_ARRAY_BUFFER, (verts.sizeof * verts.length),
verts.ptr, GL_STATIC_DRAW);
sizeof on a slice doesn't do what you think it does, it returns
the size of the actual slice object I believe.
I have to admit that I didn't
I find this a bit strange:
// get all rules that start with p...
enum BolRules = StaticFilter!(beginsWithP, __traits(allMembers,BolSource));
static assert(is(BolRules == enum));
Compiling using dmd...
source/app.d(114): Error: static assert (is(BolRules == enum)) is false
I'm trying to
On Mon, 04 May 2015 18:21:59 +0200, Robert M. Münch wrote:
I find this a bit strange:
// get all rules that start with p...
enum BolRules = StaticFilter!(beginsWithP,
__traits(allMembers,BolSource));
static assert(is(BolRules == enum));
Compiling using dmd...
source/app.d(114): Error:
On Monday, 4 May 2015 at 06:23:42 UTC, Ali Çehreli wrote:
On 05/03/2015 06:06 PM, Jonathan M Davis via
Digitalmars-d-learn wrote:
(I am eagerly waiting for your DConf talk to see how you make
sense of it all.)
Well, we'll see how much I'm able to cover about arrays. The
focus of the talk
On 2015-05-04 17:21:34 +, ketmar said:
that's due to `enum` keyword abusing. enum type is something like this:
enum MyEnum { A, B }
and
enum val = false;
is a compile-time boolean constant, which will be inlined on using. i.e.
compiler will inline such enum constants, and that
On 05/04/2015 08:36 AM, WhatMeWorry wrote:
But just for arguments sake, wouldn't it have
been better to define in dynamic array properties a .sizeofref and a
.sizeof (which behaves like the static array.sizeof)?
It would not work because
1) .sizeof means the size of the variable that a
On 2015-05-04 03:52:21 +, Rikki Cattermole said:
Have you looked at my book? https://leanpub.com/ctfe
I bought it. Will it be updated?
It's very generic with respect the concept and I'm missing code
examples for all the user-cases. Especially the generator part is IMO
very interesting.
On 05/04/2015 11:07 AM, Robert M. Münch wrote:
enum A {a, b, c};
enum members1 = __traits(allMembers, A);
auto members2 = __traits(allMembers, A);
1. So the (string, string, string) output is based on the expression of
members1? Meaning, the right-hand-side.
There are many different
On 5/05/2015 6:24 a.m., Robert M. Münch wrote:
On 2015-05-04 03:52:21 +, Rikki Cattermole said:
Have you looked at my book? https://leanpub.com/ctfe
I bought it. Will it be updated?
It's very generic with respect the concept and I'm missing code examples
for all the user-cases.
On Mon, 04 May 2015 00:16:03 -0400, Jonathan M Davis via
Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
D will move the argument if it can rather than copying it (e.g. if a
temporary is being passed in), which reduces the need for worrying about
copying like you tend to have to do
class C{
override bool opEquals( Object o){
return true;
}
}
unittest{
auto c= new C;
assert( c == c);
}
`rdmd --main -unittest -cov' shows, that opEquals is not
executed. Why?
-manfred
On Tuesday, 5 May 2015 at 02:47:03 UTC, bitwise wrote:
On Mon, 04 May 2015 00:16:03 -0400, Jonathan M Davis via
Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
D will move the argument if it can rather than copying it
(e.g. if a
temporary is being passed in), which reduces the need
On Tuesday, 5 May 2015 at 04:09:03 UTC, Manfred Nowak wrote:
class C{
override bool opEquals( Object o){
return true;
}
}
unittest{
auto c= new C;
assert( c == c);
}
`rdmd --main -unittest -cov' shows, that opEquals is not
executed. Why?
-manfred
because `c is c`
I have to compile it myself from sources or is it available
somewhere? Was playing with fibers using VisualD + DMD and lack
of contract checking (for example call() on fiber in state TERM)
leads to bizarre crashes :(
On Mon, 04 May 2015 20:07:27 +0200, Robert M. Münch wrote:
Gives this:
(string, string, string)
playground.d(9): Error: no type for typeid(members1)
playground.d(9):while evaluating pragma(msg, typeid(members1))
`typeid` is runtime thing, you can't use it in compile-time.
Can some one tell me what this linker command means (or point me
at some docs) please:
dmd example.d -L-L. $@
AFAIK $@ is 'all the supplied arguments' so I don't understand
what it achieves.
(it's from the DAllegro5 example program, on Linux).
Cheers,
Paul
On Sunday, 3 May 2015 at 14:37:32 UTC, Per Nordlöw wrote:
On Saturday, 2 May 2015 at 20:37:44 UTC, tom wrote:
i use Stephan Schiffels code from
http://forum.dlang.org/thread/djhteyhpcnaskpabx...@forum.dlang.org?page=2
See polished version at:
27 matches
Mail list logo