Inline assembly and Profiling

2016-02-29 Thread Matthew Dudley via Digitalmars-d-learn
I'm working on a chess engine side-project, and I'm starting to get into profiling and optimization. One of the optimizations I've made involves some inline assembly, and I ran across some apparently bizarre behavior today, and I just wanted to double-check that I'm not doing something wrong.

Re: Auto return type inference issue?

2014-04-23 Thread Matthew Dudley via Digitalmars-d-learn
On Wednesday, 23 April 2014 at 00:02:29 UTC, Jesse Phillips wrote: On Tuesday, 22 April 2014 at 07:54:34 UTC, Matthew Dudley wrote: Here's the gist of what I'm trying to do. https://gist.github.com/pontifechs/11169069 I'm getting an error I don't understand: tinker.d(42

Auto return type inference issue?

2014-04-22 Thread Matthew Dudley via Digitalmars-d-learn
Here's the gist of what I'm trying to do. https://gist.github.com/pontifechs/11169069 I'm getting an error I don't understand: tinker.d(42): Error: mismatched function return type inference of tinker.B and tinker.A tinker.d(55): Error: template instance tinker.DynamicTuple!(A, B).DynamicTuple

Re: Templated static opCall in non-templated struct

2014-02-11 Thread Matthew Dudley
On Wednesday, 12 February 2014 at 01:59:54 UTC, Frustrated wrote: On Tuesday, 11 February 2014 at 00:00:06 UTC, Matthew Dudley wrote: Here's the gist of what I'm trying to do: struct Foo { public: int i; int j; static opCall(int i)(in

Re: Templated static opCall in non-templated struct

2014-02-11 Thread Matthew Dudley
On Tuesday, 11 February 2014 at 19:15:25 UTC, Philippe Sigaud wrote: On Tue, Feb 11, 2014 at 1:05 AM, Namespace wrote: static opCall(int i)(int j, int k) { return Foo(i+j,i+k); } auto bob = Foo!(1)(2,3); //Error: Welcome to my world ;) htt

Re: Templated static opCall in non-templated struct

2014-02-11 Thread Matthew Dudley
On Tuesday, 11 February 2014 at 00:00:06 UTC, Matthew Dudley wrote: Here's the gist of what I'm trying to do: struct Foo { public: int i; int j; static opCall(int i)(int j, int k) { return Foo(i+j,i+k); } } void main() {

Templated static opCall in non-templated struct

2014-02-11 Thread Matthew Dudley
Here's the gist of what I'm trying to do: struct Foo { public: int i; int j; static opCall(int i)(int j, int k) { return Foo(i+j,i+k); } } void main() { auto bob = Foo!(1)(2,3); //Error: template instance Foo!1 Foo is not a templa

Re: std.typecons wrap interface with NVI

2014-02-02 Thread Matthew Dudley
On Sunday, 2 February 2014 at 11:07:41 UTC, Dicebot wrote: `wrap` has relatively simple meaning: for any interface I and class C it generates class C' inheriting I and implementing all methods of I in terms of forwarding calls to methods of C with same name and signature. What does happen her

std.typecons wrap interface with NVI

2014-02-01 Thread Matthew Dudley
This is the general outline of what I'm trying to do: import std.typecons; //wrap import std.stdio; interface FooBar { public: void foo(); void bar(); final void both() // NVI { foo(); bar();

Template types in parameter lists

2014-01-31 Thread Matthew Dudley
So this is the general form of what I'm trying to do: import std.stdio; class Foo(uint something) { Foo opBinary(string op)(Foo rhs) const if (op == "*") { writeln("calling Foo.*"); } } class Bar : Foo!(3) { // ... } class Baz : Foo!(4) { //... } void main() { auto bar =