On Saturday, 29 April 2017 at 18:54:36 UTC, سليمان السهمي
(Soulaïman Sahmi) wrote:
But still, this needs to be fixed, copy pasting the name
mangling is in my opinion just a hack for your specific cpp
compiler on your specific platform.
It can't be fixed on the D side as the Visual C++ mangling
On Saturday, 29 April 2017 at 08:08:27 UTC, ParticlePeter wrote:
On Saturday, 29 April 2017 at 00:31:32 UTC, Nicholas Wilson
wrote:
If you are having problems with the linker with Ali's you can
do
```
extern(C++) bool cppFunc( float[3] color ); // correct
signature, but causes compiler error
On Saturday, 29 April 2017 at 10:17:47 UTC, Atila Neves wrote:
On Saturday, 29 April 2017 at 06:22:03 UTC, ParticlePeter wrote:
On Saturday, 29 April 2017 at 01:49:56 UTC, Atila Neves wrote:
On Friday, 28 April 2017 at 18:41:22 UTC, kinke wrote:
[...]
The worst part about that is mangling as
On Saturday, 29 April 2017 at 06:22:03 UTC, ParticlePeter wrote:
On Saturday, 29 April 2017 at 01:49:56 UTC, Atila Neves wrote:
On Friday, 28 April 2017 at 18:41:22 UTC, kinke wrote:
[...]
The worst part about that is mangling aside, the two
declarations are identical to the compiler.
Atil
On Saturday, 29 April 2017 at 00:31:32 UTC, Nicholas Wilson wrote:
If you are having problems with the linker with Ali's you can do
```
extern(C++) bool cppFunc( float[3] color ); // correct
signature, but causes compiler error
pragma(mangle, cppFunc.mangleof)
float cppFunc(float * color); //
On Saturday, 29 April 2017 at 01:49:56 UTC, Atila Neves wrote:
On Friday, 28 April 2017 at 18:41:22 UTC, kinke wrote:
On Friday, 28 April 2017 at 18:07:49 UTC, ParticlePeter wrote:
Interesting, your example corresponds to my third case, the
linker error. I am on Window, building an x64 App, afa
On Friday, 28 April 2017 at 18:41:22 UTC, kinke wrote:
On Friday, 28 April 2017 at 18:07:49 UTC, ParticlePeter wrote:
Interesting, your example corresponds to my third case, the
linker error. I am on Window, building an x64 App, afaik in
that case the MS Visual Studio linker is used instead of
On Friday, 28 April 2017 at 19:08:18 UTC, ParticlePeter wrote:
On Friday, 28 April 2017 at 17:57:34 UTC, Ali Çehreli wrote:
On 04/28/2017 08:56 AM, ParticlePeter wrote:
> C++ Function:
> bool cppFunc( float[3] color );
>
> D binding:
> extern(C++) bool cppFunc( float[3] color );
>
> Using with:
On Friday, 28 April 2017 at 17:57:34 UTC, Ali Çehreli wrote:
On 04/28/2017 08:56 AM, ParticlePeter wrote:
> C++ Function:
> bool cppFunc( float[3] color );
>
> D binding:
> extern(C++) bool cppFunc( float[3] color );
>
> Using with:
> float[3] my_color;
> cppFunc( my_color );
>
> -> Error: Intern
On Friday, 28 April 2017 at 18:07:49 UTC, ParticlePeter wrote:
Interesting, your example corresponds to my third case, the
linker error. I am on Window, building an x64 App, afaik in
that case the MS Visual Studio linker is used instead of
optilink. Will add your findings to the bug report.
A
On Friday, 28 April 2017 at 17:57:34 UTC, Ali Çehreli wrote:
On 04/28/2017 08:56 AM, ParticlePeter wrote:
> C++ Function:
> bool cppFunc( float[3] color );
>
> D binding:
> extern(C++) bool cppFunc( float[3] color );
>
> Using with:
> float[3] my_color;
> cppFunc( my_color );
>
> -> Error: Intern
On 04/28/2017 08:56 AM, ParticlePeter wrote:
> C++ Function:
> bool cppFunc( float[3] color );
>
> D binding:
> extern(C++) bool cppFunc( float[3] color );
>
> Using with:
> float[3] my_color;
> cppFunc( my_color );
>
> -> Error: Internal Compiler Error: unable to pass static array to
That part i
On Friday, 28 April 2017 at 17:15:54 UTC, kinke wrote:
On Friday, 28 April 2017 at 15:56:17 UTC, ParticlePeter wrote:
So what next? How can I interface to the cpp function?
*** C++:
bool cppFunc(float (&color)[3])
{
color[0] = 1;
color[1] = 2;
color[2] = 3;
return true;
}
***
On Friday, 28 April 2017 at 15:56:17 UTC, ParticlePeter wrote:
So what next? How can I interface to the cpp function?
*** C++:
bool cppFunc(float (&color)[3])
{
color[0] = 1;
color[1] = 2;
color[2] = 3;
return true;
}
*** D:
extern(C++) bool cppFunc(ref float[3] color);
void
Report a bug.
C++ Function:
bool cppFunc( float[3] color );
D binding:
extern(C++) bool cppFunc( float[3] color );
Using with:
float[3] my_color;
cppFunc( my_color );
-> Error: Internal Compiler Error: unable to pass static array to
extern(C++) function.
Error: Use pointer instead.
Using with:
cppFunc( m
On Monday, 31 August 2015 at 13:17:30 UTC, cym13 wrote:
On Monday, 31 August 2015 at 13:00:49 UTC, Namal wrote:
Hey guys, since I am learning D arrays here, can you tell me
the best way to remove an element at the end of an array or at
some index i?
import std.algorithm;
T[] arr;
arr = arr.r
On Monday, 31 August 2015 at 13:00:49 UTC, Namal wrote:
Hey guys, since I am learning D arrays here, can you tell me
the best way to remove an element at the end of an array or at
some index i?
import std.algorithm;
T[] arr;
arr = arr.remove(index);
http://p0nce.github.io/d-idioms/#Adding-or
Hey guys, since I am learning D arrays here, can you tell me the
best way to remove an element at the end of an array or at some
index i?
On Monday, 31 August 2015 at 12:00:26 UTC, bearophile wrote:
Namal:
std::vector foo(int N){
std::vector V(N);
int some_array[N];
VLAs are not present in D.
Bye,
bearophile
Yah, I guess I have been damaged with them when I started to
learn programming in C++ >(
Namal:
std::vector foo(int N){
std::vector V(N);
int some_array[N];
VLAs are not present in D.
Bye,
bearophile
On Monday, 31 August 2015 at 11:27:20 UTC, Rikki Cattermole wrote:
You cannot define static arrays using runtime information.
You must use dynamic arrays.
int[] foo(int N) {
int[] v;
v.length = N;
// do something with it
int[] 2;
return s;
}
Of course y
On 31/08/15 11:24 PM, Namal wrote:
Hello,
can someone explain to me please what I am doing wrong by passing an
integer to this function and then just creating a static array? The
error I get is:
Error: variable N cannot be read at compile time
int[] foo(int N){
int[N] v;
//do somet
Hello,
can someone explain to me please what I am doing wrong by passing
an integer to this function and then just creating a static
array? The error I get is:
Error: variable N cannot be read at compile time
int[] foo(int N){
int[N] v;
//do something with it
int[]
24 matches
Mail list logo