On Thursday, 5 May 2016 at 00:03:34 UTC, Brian Schott wrote:
On Wednesday, 4 May 2016 at 23:19:08 UTC, Jonathan Villa wrote:
What I'm doing wrong? :<
All right. D's type system is marking the `Session` constructor
as `shared`. This makes the check `static if
On Wednesday, 4 May 2016 at 23:19:08 UTC, Jonathan Villa wrote:
What I'm doing wrong? :<
All right. D's type system is marking the `Session` constructor
as `shared`. This makes the check `static if
(is(typeof(result.__ctor(args` in std.conv.emplace fail
because `result` is a non-shared
On Wednesday, 4 May 2016 at 23:34:52 UTC, Jonathan Villa wrote:
On Wednesday, 4 May 2016 at 23:33:28 UTC, Brian Schott wrote:
On Wednesday, 4 May 2016 at 23:19:08 UTC, Jonathan Villa wrote:
What I'm doing wrong? :<
I see that the types of `id_user` aren't necessarily the same
between
On Wednesday, 4 May 2016 at 23:33:28 UTC, Brian Schott wrote:
On Wednesday, 4 May 2016 at 23:19:08 UTC, Jonathan Villa wrote:
What I'm doing wrong? :<
I see that the types of `id_user` aren't necessarily the same
between `create` and `this`.
Oh, they are indeed same (alias). I wrote uint
On Wednesday, 4 May 2016 at 23:19:08 UTC, Jonathan Villa wrote:
What I'm doing wrong? :<
I see that the types of `id_user` aren't necessarily the same
between `create` and `this`.
...
import std.experimental.allocator : make, dispose;
import std.experimental.allocator.mallocator : Mallocator;
public synchronized class Session
{
private:
ASI parent;
cUser user;
public:
static Session create(ASI _parent,
accounts.user.id_user_t id_user)
I want to have a struct template auto instantiate when the
template parameters are defaulted or missing. Example:
struct Resource(T=int) {
static auto create() {return Resource(null);}
this(string s) {}
}
auto resource = Resource.create;
As a plain struct it works, but not as a
On Wednesday, 4 May 2016 at 09:40:55 UTC, Benjamin Thaut wrote:
On Tuesday, 3 May 2016 at 19:06:30 UTC, cc wrote:
it fails to link with "Error 42: Symbol Undefined
_FMOD_System_CreateSound@20". With extern(C) it compiles and
runs but the problem from above persists.
Is this on Windows
On Wednesday, 4 May 2016 at 14:54:39 UTC, chmike wrote:
Two constructors, one accepting a function and the other one
accepting a delegate would do the job for the API. Is there a
simple method to convert a function pointer into a delegate
pointer that is also efficient ?
On Wednesday, 4 May 2016 at 14:54:39 UTC, chmike wrote:
Two constructors, one accepting a function and the other one
accepting a delegate would do the job for the API. Is there a
simple method to convert a function pointer into a delegate
pointer that is also efficient ?
Do the overload and
I have implemented the following class (simplified ;) )
class Foo(K,T) {
this(T delegate (K) factory) { m_factory = factory; }
T delegate (K) m_factory;
T bar(K key) { return m_factory(key); }
}
string dummyFactory(string key) { return "Hello "~key; }
void main()
{
auto
Thank you Basile and Teoh.
On Wednesday, 4 May 2016 at 11:19:59 UTC, chmike wrote:
I think you misunderstood the second question.
Here is another attempt with an example.
// function accepting a function as argument
void foo(function void fg(int)) {
fg(5);
}
// A class with a none static method with the same
On Wed, May 04, 2016 at 06:21:36AM +, chmike via Digitalmars-d-learn wrote:
> Hello,
>
> I failed to find some code example for a template class/struct that
> accept a function/delegate as template argument. All examples I could
> find use simple value types like int or double.
The usual way
On Wednesday, 4 May 2016 at 10:58:04 UTC, chmike wrote:
On Wednesday, 4 May 2016 at 06:59:00 UTC, Basile B. wrote:
. . .
void main(string[] args)
{
alias fun = (a) => a.writeln;
auto foo = Foo!fun("hello");
}
Is this equivalent to Foo!(a => a.writeln) or is it required to
split this
I think you misunderstood the second question.
Here is another attempt with an example.
// function accepting a function as argument
void foo(function void fg(int)) {
fg(5);
}
// A class with a none static method with the same signature as
the argument function of foo
class Bar {
On Wednesday, 4 May 2016 at 06:59:00 UTC, Basile B. wrote:
. . .
void main(string[] args)
{
alias fun = (a) => a.writeln;
auto foo = Foo!fun("hello");
}
Is this equivalent to Foo!(a => a.writeln) or is it required to
split this in two instructions as you did ? I also thought the
On Wednesday, 4 May 2016 at 10:01:54 UTC, Suliman wrote:
After some minor modification of my code I begun to get error:
Error 1: Previous Definition Different :
_D3app14onlinetestdataFC4vibe4http6server17HTTPServerRequestC4vibe4http6server18HTTPServerResponseZv
Here is my code:
After some minor modification of my code I begun to get error:
Error 1: Previous Definition Different :
_D3app14onlinetestdataFC4vibe4http6server17HTTPServerRequestC4vibe4http6server18HTTPServerResponseZv
Here is my code:
https://gist.github.com/bubnenkoff/db0632bb14eebb7690b6563c47395831
On 5/3/16 5:31 PM, vino wrote:
On Friday, 10 September 2010 at 15:15:38 UTC, Andrej Mitrovic wrote:
Yeah, one would think the destination is on the left (just like the
standard C way of doing it), but it's not. I checked it in the docs
and the source. And idup works, thanks.
Kagamin Wrote:
On Tuesday, 3 May 2016 at 19:06:30 UTC, cc wrote:
it fails to link with "Error 42: Symbol Undefined
_FMOD_System_CreateSound@20". With extern(C) it compiles and
runs but the problem from above persists.
Is this on Windows x64? Try replacing FMOD_RESULT by int. When
declaring the fmod
On Wednesday, 4 May 2016 at 06:37:28 UTC, Nordlöw wrote:
On Tuesday, 3 May 2016 at 12:31:10 UTC, Benjamin Thaut wrote:
I assume this is on windows? Yes its a known issue (I know
No, the problem occurs on my Linux aswell.
From core.runtime:
static this()
{
// NOTE: Some module ctors
On Wednesday, 4 May 2016 at 06:21:36 UTC, chmike wrote:
Hello,
I failed to find some code example for a template class/struct
that accept a function/delegate as template argument. All
examples I could find use simple value types like int or double.
I piggy bag another question. Defining a
On Wednesday, 4 May 2016 at 06:21:36 UTC, chmike wrote:
Hello,
I failed to find some code example for a template class/struct
that accept a function/delegate as template argument. All
examples I could find use simple value types like int or double.
I piggy bag another question. Defining a
On Tuesday, 3 May 2016 at 12:31:10 UTC, Benjamin Thaut wrote:
I assume this is on windows? Yes its a known issue (I know
No, the problem occurs on my Linux aswell.
Hello,
I failed to find some code example for a template class/struct
that accept a function/delegate as template argument. All
examples I could find use simple value types like int or double.
I piggy bag another question. Defining a function/delegate as
function argument is shown in
26 matches
Mail list logo