Re: Can assumeSafeAppend() grab more and more capacity?

2017-06-06 Thread ag0aep6g via Digitalmars-d-learn
On 06/07/2017 12:12 AM, Ali Çehreli wrote: On 06/06/2017 12:13 PM, Jesse Phillips wrote: > On Monday, 5 June 2017 at 23:17:46 UTC, Ali Çehreli wrote: >> auto a = [ 1, 2, 3, 4 ]; >> auto b = a; [...] The only issue remaining for me is the part that you've quoted: Jesse Phillips

Re: Can assumeSafeAppend() grab more and more capacity?

2017-06-06 Thread Ali Çehreli via Digitalmars-d-learn
On 06/06/2017 12:13 PM, Jesse Phillips wrote: > On Monday, 5 June 2017 at 23:17:46 UTC, Ali Çehreli wrote: >> auto a = [ 1, 2, 3, 4 ]; >> auto b = a; >> >> Both of those slices have non-zero capacity yet one of them will be >> the lucky one to grab it. Such semantic issues make me

Re: Can assumeSafeAppend() grab more and more capacity?

2017-06-06 Thread Jesse Phillips via Digitalmars-d-learn
On Monday, 5 June 2017 at 23:17:46 UTC, Ali Çehreli wrote: auto a = [ 1, 2, 3, 4 ]; auto b = a; Both of those slices have non-zero capacity yet one of them will be the lucky one to grab it. Such semantic issues make me unhappy. :-/ Ali You have to remember that slices don't own

Re: Use template functions within mixin

2017-06-06 Thread Ali Çehreli via Digitalmars-d-learn
Just import modules at local scopes. Here is something that works: void displayinfo(T)(T v) { import std.stdio : writefln; writefln("%08x", v); } void foo() { import std.meta : AliasSeq; enum value = cast(ubyte[])x"33 3a 3f d4"; foreach (type; AliasSeq!(int, uint, byte)) {

Re: gdc and shared objects

2017-06-06 Thread Mike Wey via Digitalmars-d-learn
On 06/06/2017 05:07 PM, Russel Winder via Digitalmars-d-learn wrote: I hope I am just missing an option as everything seems to be there fore this to work. You are missing the `-shared-libphobos` option. -- Mike Wey

Re: Avast virus warning?

2017-06-06 Thread Laeeth Isharc via Digitalmars-d-learn
On Monday, 5 June 2017 at 16:31:04 UTC, Anonymouse wrote: I just sent a pre-compiled .exe of my project to a friend, and his Avast anti-virus promptly quarantined it and sent it off for analysis. I tried sending him a Hello World[1] with the same results. Is this something common for d

Re: Use template functions within mixin

2017-06-06 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, June 06, 2017 15:00:50 Timoses via Digitalmars-d-learn wrote: > Hey there, > > I'm wondering how I can use a template function within my mixin: > > ``` > ubyte[] value = x[33, 3a,3f, d4]; > foreach (type; TypeTuple!("int", "unsigned int", > "byte")) >

Re: Use template functions within mixin

2017-06-06 Thread Patrick Schluter via Digitalmars-d-learn
On Tuesday, 6 June 2017 at 15:00:50 UTC, Timoses wrote: Hey there, I'm wondering how I can use a template function within my mixin: ``` ubyte[] value = x[33, 3a,3f, d4]; foreach (type; TypeTuple!("int", "unsigned int", "byte")) {

gdc and shared objects

2017-06-06 Thread Russel Winder via Digitalmars-d-learn
using gdc (Debian 6.3.0-18) 6.3.0 20170516 I find: gdc -I. -fPIC -c -o code.o code.d gdc -o libanswer.so -shared code.o leads to problems because the linker tries to link against: /usr/lib/gcc/x86_64-linux-gnu/6/libgdruntime.a instead of against one of:

Use template functions within mixin

2017-06-06 Thread Timoses via Digitalmars-d-learn
Hey there, I'm wondering how I can use a template function within my mixin: ``` ubyte[] value = x[33, 3a,3f, d4]; foreach (type; TypeTuple!("int", "unsigned int", "byte")) { mixin(`if (value.length == type.sizeof)