On 21/06/15 16:09, Sean Campbell wrote:
extern(C++) void d_initialize() {
Runtime.initialize();
}
extern(C++) void d_terminate()
{
Runtime.terminate();
}
These two functions are not necessary. There are already functions in
druntime which are supposed to be called from C/C++:
On Sunday, 21 June 2015 at 10:06:15 UTC, biozic wrote:
You can use a template alias parameter with a default value
that is your default lambda:
int indexOfMax(alias fun = a = a, R)(R range)
{
// Use `fun` here like a function.
}
-- Nico
Thanks a lot, it works !!
On Sunday, 21 June 2015 at 13:12:03 UTC, MGW wrote:
Linux 32, dmd 2.067.0
I want to connect and execute function D from main() C++.
d1.d
import core.stdc.stdio;
extern (C++) void d1() {
printf(printf - exec d1());
}
main_c1.cpp
#include stdio.h
void d1(void);
int
Linux 32, dmd 2.067.0
I want to connect and execute function D from main() C++.
d1.d
import core.stdc.stdio;
extern (C++) void d1() {
printf(printf - exec d1());
}
main_c1.cpp
#include stdio.h
void d1(void);
int main(void) {
d1();
return 0;
}
compile
Suppose I have:
import std.range;
auto a=iota(complex_expr_returning_3());
I'd like to have a function/trait/template/compiler magic that takes
variable a and generates a string that can be mixed in to represent the
type of a. The difficulty is that typeid(a).to!string doesn't work for
On Saturday, 20 June 2015 at 22:44:17 UTC, Ali Çehreli wrote:
On 06/20/2015 02:09 PM, Xiaoxi wrote:
The output:
before
deneme.S.this
after
deneme.S.~this
Ali
Dear Ali,
thank you for helping! Problem happens when passing by value as
in param.
DMD32 D Compiler v2.067.0
deneme.S.this
before
Dear Ali,
thank you for helping! Problem happens when passing by value as
in param.
Change 'foo' to this:
ref S foo(ref S s)
{
s.val+=1;
return s;
}
Hi,
I need to find the index of maximum element so my code:
int indexOfMax(R)(R range)
{
alias Type = typeof(range.front().re); I don't like
.re here
Type max = 0;
size_t maxIndex = 0;
foreach ( index,elem; range )
{
if ( elem.re max )- And
On Sunday, 21 June 2015 at 09:34:51 UTC, kerdemdemir wrote:
Hi,
I need to find the index of maximum element so my code:
int indexOfMax(R)(R range)
{
alias Type = typeof(range.front().re); I don't like
.re here
Type max = 0;
size_t maxIndex = 0;
foreach (