On Sunday, 1 May 2016 at 19:18:38 UTC, Basile B wrote:
CT make(CT, Alloc, A...)(auto ref Alloc al, A a)
This works. Thank you. Good point about __ctor alone not being
sufficient.
auto memory = al.allocate(size);
...
GC.addRange(memory.ptr, size, typeid(CT));
Nit:
On Sun, 01 May 2016 18:27:51 +
Lass Safin via Digitalmars-d-learn
wrote:
> On Sunday, 1 May 2016 at 11:17:27 UTC, earthfront wrote:
> > Hello!
> > [...]
> > class A
> >{ int b; private this(int a){b=a;} }
> > [...]
>
> I don't think classes are
when it cannot match a prototype eg:
module foo;
enum Foo
{
foo
}
void bar(Foo foo)
{
}
module bar;
enum Foo
{
foo
}
void fooBar(Foo foo)
{
bar(foo);
}
rather than complain the type X does not match the type X - an
unhelpful message - could the compiler not check to see if the
type
On Sunday, 1 May 2016 at 09:11:22 UTC, ag0aep6g wrote:
It's because of auto-decoding. char[] is an array of chars, but
it's been made a range of dchars. Calling front on a char[]
decodes up to four chars into one dchar.
Obviously you can't take the address of the dchar, because it's
just a
On Sunday, 1 May 2016 at 11:17:27 UTC, earthfront wrote:
Hello!
This code fails:
-
void main(){
class A
{ int b; private this(int a){b=a;} }
//{ int b; this(int a){b=a;} }
import std.conv:emplace;
import std.experimental.allocator.mallocator:Mallocator;
import
On Sunday, 1 May 2016 at 11:17:27 UTC, earthfront wrote:
Hello!
[...]
class A
{ int b; private this(int a){b=a;} }
[...]
I don't think classes are supposed to be able to have a private
constructor...
On Sunday, 1 May 2016 at 13:22:27 UTC, Mithun Hunsur wrote:
On Sunday, 1 May 2016 at 10:37:23 UTC, Anonymouse wrote:
On Sunday, 1 May 2016 at 05:28:36 UTC, Mithun Hunsur wrote:
Hi all,
I'm working on removing the string mixins from my code, but
have run into an issue:
On Sunday, 1 May 2016 at 13:46:14 UTC, ag0aep6g wrote:
On 01.05.2016 15:32, pineapple wrote:
static string vectorpropertymixin(string name, string
SDL_getter, string
SDL_setter){
[...]
mixin(vectorpropertymixin(
"minsize", "SDL_GetWindowMinimumSize",
"SDL_GetWindowMinimumSize"
));
On 01.05.2016 15:32, pineapple wrote:
static string vectorpropertymixin(string name, string SDL_getter, string
SDL_setter){
[...]
mixin(vectorpropertymixin(
"minsize", "SDL_GetWindowMinimumSize", "SDL_GetWindowMinimumSize"
));
Should the second one be "SDL_SetWindowMinimumSize" here?
Strangely, though I'm getting this error when wrapping
SDL_GetWindowMinimumSize and SDL_GetWindowMaximumSize, I don't
get any compilation errors wrapping the identically-signatured
SDL_GetWindowSize and SDL_GetWindowPosition using the same mixin.
I'm working on an SDL wrapper based on the derelict sdl2 and
opengl3 bindings and so I've got a method like this I wrote:
@property Vector2!int minsize(){
int x, y;
SDL_GetWindowMinimumSize(this.window, , );
return Vector2!int(x, y);
}
I've got several almost identical methods for
On Sunday, 1 May 2016 at 10:37:23 UTC, Anonymouse wrote:
On Sunday, 1 May 2016 at 05:28:36 UTC, Mithun Hunsur wrote:
Hi all,
I'm working on removing the string mixins from my code, but
have run into an issue:
http://dpaste.dzfl.pl/ecd7eb53947e
As far as I can tell, this should work; the
I am failing to link statically to glfw library with deimos glfw.
The repo includes an example for glfw2. I downloaded the latest
glfw2.lib and tried build the example with -m64 and got these
errors:
C:\ ... \deimos-glfw>dmd GLFW.lib
examples/glfw2/openwindow/openwindow.d -m64
Hello!
This code fails:
-
void main(){
class A
{ int b; private this(int a){b=a;} }
//{ int b; this(int a){b=a;} }
import std.conv:emplace;
import std.experimental.allocator.mallocator:Mallocator;
import std.experimental.allocator:make;
{
auto ptr =
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 Sunday, 1 May 2016 at 10:13:47 UTC, H. S. Teoh wrote:
On Sun, May 01, 2016 at 09:42:37AM +, ParticlePeter via
Digitalmars-d-learn wrote:
I am logging arbitrary POD struct types with member names and
data:
void printStructInfo( T )( T info ) {
foreach( i, A; typeof( T.tupleof )) {
On Sunday, 1 May 2016 at 05:28:36 UTC, Mithun Hunsur wrote:
Hi all,
I'm working on removing the string mixins from my code, but
have run into an issue:
http://dpaste.dzfl.pl/ecd7eb53947e
As far as I can tell, this should work; the enum should force
compile-time execution (which it does, as
On Sunday, 1 May 2016 at 08:14:43 UTC, Nicholas Wilson wrote:
On Sunday, 1 May 2016 at 05:28:36 UTC, Mithun Hunsur wrote:
Hi all,
I'm working on removing the string mixins from my code, but
have run into an issue:
http://dpaste.dzfl.pl/ecd7eb53947e
As far as I can tell, this should work;
On Sun, May 01, 2016 at 09:42:37AM +, ParticlePeter via Digitalmars-d-learn
wrote:
> I am logging arbitrary POD struct types with member names and data:
>
> void printStructInfo( T )( T info ) {
> foreach( i, A; typeof( T.tupleof )) {
> enum attribName = T.tupleof[i].stringof;
>
I am logging arbitrary POD struct types with member names and
data:
void printStructInfo( T )( T info ) {
foreach( i, A; typeof( T.tupleof )) {
enum attribName = T.tupleof[i].stringof;
writefln( "%s : %s", attribName, mixin( "info." ~ attribName
));
}
}
Is there is some other way
On 01.05.2016 07:29, TheGag96 wrote:
Why exactly is it like this? I would understand why strings (immutable
character arrays) behave like this, but I feel like plain old character
arrays should work the same as an array of ubytes when treated as a
range... Or is there some other string-related
On Sunday, 1 May 2016 at 05:28:36 UTC, Mithun Hunsur wrote:
Hi all,
I'm working on removing the string mixins from my code, but
have run into an issue:
http://dpaste.dzfl.pl/ecd7eb53947e
As far as I can tell, this should work; the enum should force
compile-time execution (which it does, as
22 matches
Mail list logo