Am Mon, 15 May 2017 19:30:00 +
schrieb Bauss :
> pragma(inline, true); doesn't actually do what you think it does.
> In lining is always done whenever possible and that only tells
> the compiler to spit out an error if it can't inline it.
A compiler doesn't simply inline whenever it can. A
On Sunday, 14 May 2017 at 21:07:36 UTC, Marco Leise wrote:
Am Sun, 14 May 2017 20:18:24 +
schrieb Kevin Brogan :
[...]
No, that is not possible. An alias can only be assigned a
symbol.
[...]
Let the compiler optimize the assignment away and don't worry
much about it. Inlining also
On Sunday, 14 May 2017 at 22:00:58 UTC, Stanislav Blinov wrote:
[...]
Yep, it's an alias to template function instantiation, that is,
concrete function - a symbol.
Yes, my bad :(
But of course, it *is* going to be called on every
"dereference". GDC optimizes the call away starting at -O1,
On Sunday, 14 May 2017 at 21:55:01 UTC, ag0aep6g wrote:
On 05/14/2017 11:35 PM, Moritz Maxeiner wrote:
On Sunday, 14 May 2017 at 21:16:04 UTC, Stanislav Blinov wrote:
[...]
T* ptrCast(T, alias ptr)() { return cast(T*)ptr; }
[...]
alias _state = ptrCast!(int, state);
[...]
That's a prett
On Sunday, 14 May 2017 at 21:55:01 UTC, ag0aep6g wrote:
On 05/14/2017 11:35 PM, Moritz Maxeiner wrote:
On Sunday, 14 May 2017 at 21:16:04 UTC, Stanislav Blinov wrote:
[...]
T* ptrCast(T, alias ptr)() { return cast(T*)ptr; }
[...]
alias _state = ptrCast!(int, state);
[...]
That's a prett
On 05/14/2017 11:35 PM, Moritz Maxeiner wrote:
On Sunday, 14 May 2017 at 21:16:04 UTC, Stanislav Blinov wrote:
[...]
T* ptrCast(T, alias ptr)() { return cast(T*)ptr; }
[...]
alias _state = ptrCast!(int, state);
[...]
That's a pretty cool workaround, but not an alias to the cast, but an
On Sunday, 14 May 2017 at 21:16:04 UTC, Stanislav Blinov wrote:
On the point of "not possible...", "only a symbol...", etc:
T* ptrCast(T, alias ptr)() { return cast(T*)ptr; }
void addInt(void* state, void* data)
{
alias _state = ptrCast!(int, state);
alias _data = ptrCast!(int, data);
On the point of "not possible...", "only a symbol...", etc:
T* ptrCast(T, alias ptr)() { return cast(T*)ptr; }
void addInt(void* state, void* data)
{
alias _state = ptrCast!(int, state);
alias _data = ptrCast!(int, data);
static assert(!is(typeof(_state) == int*));
static assert
On Sunday, 14 May 2017 at 20:18:24 UTC, Kevin Brogan wrote:
I have a piece of code that takes a callback function.
The callback has the signature void callback(void* state, void*
data)
There are several of these functions. All of them use state and
data as differing types.
As an example, l
Am Sun, 14 May 2017 20:18:24 +
schrieb Kevin Brogan :
> I have a piece of code that takes a callback function.
>
> The callback has the signature void callback(void* state, void*
> data)
>
> There are several of these functions. All of them use state and
> data as differing types.
>
> As
On Sunday, 14 May 2017 at 20:18:24 UTC, Kevin Brogan wrote:
I have a piece of code that takes a callback function.
The callback has the signature void callback(void* state, void*
data)
There are several of these functions. All of them use state and
data as differing types.
As an example, l
11 matches
Mail list logo