[snip]
Forgot to add another question. The mentioned error message is
not too helpful in locating the real offended code. Is there a
way to get more information or additional hints about the actual
cause of the problem?
On Sunday, 20 December 2020 at 15:52:39 UTC, Adam D. Ruppe wrote:
On Sunday, 20 December 2020 at 15:45:59 UTC, ParticlePeter
wrote:
VkSemaphore[] wait_semaphores = [], //
error: TypeInfo required
does it still error if you just use = null? they work the same
way but migh
Hello,
I am experimenting with betterC and Vulkan through Erupted [0]
binding, but unfortunately I find myself hunting down these kind
of errors:
..\ErupteD\source\erupted\types.d-mixin-77(77,1): Error:
`TypeInfo` cannot be used with -betterC
The issue is with Vulkan type handles. One such
On Tuesday, 1 September 2020 at 14:45:43 UTC, Andre Pany wrote:
On Tuesday, 1 September 2020 at 11:45:34 UTC, ParticlePeter
wrote:
[snip]
I have a enhancement for dub in my mind, which would also solve
your issue. Similiar to setup.py in python you would be able to
define an entry point in d
Hello,
I have a targetType sourceLibrary and demonstrate its usage
through a subPackage. For the library itself 'dub run' is
meaningless, but not for the subPackage.
Is there a way to tell dub through dub.sdl or dub.json to build
and run a specific subPackage by default, without having to call
On Thursday, 28 November 2019 at 14:00:56 UTC, Adam D. Ruppe
wrote:
On Wednesday, 27 November 2019 at 15:14:21 UTC, ParticlePeter
wrote:
I judged it being the least feasible to produce appropriate
doc comments. How could this work?
Just like:
/// Forwards members to [Whatever]
auto opDispatch
On Wednesday, 27 November 2019 at 15:14:21 UTC, ParticlePeter
wrote:
On Tuesday, 26 November 2019 at 19:41:26 UTC, Adam D. Ruppe
wrote:
On Tuesday, 26 November 2019 at 19:27:55 UTC, ParticlePeter
wrote:
In may case I use the string mixin to forward outer struct
property calls to members of an i
On Tuesday, 26 November 2019 at 19:41:26 UTC, Adam D. Ruppe wrote:
On Tuesday, 26 November 2019 at 19:27:55 UTC, ParticlePeter
wrote:
In may case I use the string mixin to forward outer struct
property calls to members of an inner struct.
Did you try opDispatch btw? It might be simpler to impl
On Tuesday, 26 November 2019 at 13:02:39 UTC, Jonathan M Davis
wrote:
On Monday, November 25, 2019 9:25:08 AM MST ParticlePeter via
...
- Jonathan M Davis
Thanks for that thorough explanation. In may case I use the
string mixin to forward outer struct property calls to members of
an inner st
I would like to auto convert c++ header to d module. Is there
some project aiming for this?
I know of VisualD c++ to d conversion wizzard [1] and LLVM
tooling based CPP2D [2], both of them aiming for whole cpp
conversion. But I a searching for something lightweight like HTOD
extended to C++.
I am producing a bunch of functions/methods through string
mixins. I also generated DDoc comments for those functions, in
the hope that they would produce proper documentation, but they
don't. So how can this be accomplished?
On Monday, 26 February 2018 at 14:42:58 UTC, Adam D. Ruppe wrote:
On Monday, 26 February 2018 at 14:38:22 UTC, ParticlePeter
wrote:
This cool, I didn't know that we can name mixins when
instantiating but also never taught that there could be any
purpose for naming. Works, thanks.
oh yes, ther
On Monday, 26 February 2018 at 14:02:56 UTC, Adam D. Ruppe wrote:
On Monday, 26 February 2018 at 12:30:24 UTC, ParticlePeter
wrote:
Is this expected behavior?
yes sort of, but there are bugs associated with it too...
I wrote about this in the "Tip of the Week" section here before
http://arsd
On Monday, 26 February 2018 at 12:47:48 UTC, Jonathan M Davis
wrote:
On Monday, February 26, 2018 12:30:24 ParticlePeter via
Digitalmars-d-learn wrote:
mixin template Common() {
private int m_member;
this( int m ) { m_member = m; }
}
struct Foo {
mixin Common;
}
struct Bar {
mixin
mixin template Common() {
private int m_member;
this( int m ) { m_member = m; }
}
struct Foo {
mixin Common;
}
struct Bar {
mixin Common;
this( int m, float n ) { m_member = m * n; }
}
auto foo = Foo(1); // ok
auto b_1 = Bar( 1, 2 ); // ok
auto b_2 = Bar( 3 ); // Error: co
On Wednesday, 21 February 2018 at 14:29:31 UTC, Simen Kjærås
wrote:
On Wednesday, 21 February 2018 at 14:11:10 UTC, ParticlePeter
wrote:
struct Foo(T) {
T bar;
this(S)(S s) {
bar = convert(s);
}
}
auto foo = Foo!int(some_float);
this works because S is deduced as typeof(some_float),
struct Foo(T) {
T bar;
this(S)(S s) {
bar = convert(s);
}
}
auto foo = Foo!int(some_float);
this works because S is deduced as typeof(some_float), but how
would I instantiate the struct without relying on auto deduction?
Suppose we would have this kind of constructor where auto
de
On Sunday, 17 December 2017 at 20:09:02 UTC, ParticlePeter wrote:
On Sunday, 17 December 2017 at 19:29:00 UTC, ParticlePeter
wrote:
On Sunday, 17 December 2017 at 19:16:02 UTC, ParticlePeter
[snip]
LINKCMD=%VCINSTALLDIR%\bin\HostX32\x64\link.exe
or
LINKCMD=%VCINSTALLDIR%\bin\HostX64\x64\link
On Sunday, 17 December 2017 at 19:29:00 UTC, ParticlePeter wrote:
On Sunday, 17 December 2017 at 19:16:02 UTC, ParticlePeter
wrote:
On Sunday, 17 December 2017 at 17:56:47 UTC, John wrote:
I don't think so, all that would need to be changed is this
line:
https://github.com/dlang/dmd/blob/v2.
On Sunday, 17 December 2017 at 19:16:02 UTC, ParticlePeter wrote:
On Sunday, 17 December 2017 at 17:56:47 UTC, John wrote:
I don't think so, all that would need to be changed is this
line:
https://github.com/dlang/dmd/blob/v2.077.1/ini/windows/bin/sc.ini#L53
Not very many people use it I gue
On Sunday, 17 December 2017 at 17:56:47 UTC, John wrote:
I don't think so, all that would need to be changed is this
line:
https://github.com/dlang/dmd/blob/v2.077.1/ini/windows/bin/sc.ini#L53
Not very many people use it I guess if it's been there for 8
months lol.
Hm, actually that line I
On Sunday, 17 December 2017 at 16:40:46 UTC, John wrote:
Yah the sc.ini file is wrong for Environment64.
[Environment64]
LIB="%@P%\..\lib64"
.
.
.
; Windows installer uncomments the version detected
LINKCMD=%VCINSTALLDIR%\bin\HostX86\x86\link.exe
Thanks! Is this a known, reported bug?
On Sunday, 17 December 2017 at 15:57:08 UTC, ParticlePeter wrote:
I upgraded from DMD 2.074.1 (!) to 2.077.1 and tried to compile
a mixed c++/d project (DMD links to one c++ lib). Here is the
full error message:
Forgot most important info, ita an x64 project those used VS
linker by default af
I upgraded from DMD 2.074.1 (!) to 2.077.1 and tried to compile a
mixed c++/d project (DMD links to one c++ lib). Here is the full
error message:
fatal error C1905: Front end and back end not compatible (must
target same processor).
LINK : fatal error LNK1257: code generation failed
Error: li
On Friday, 10 November 2017 at 11:55:57 UTC, Guillaume Piolat
wrote:
For now we do have some @nogc alternatives for mutex, condition
variables, thread-pool, file reading, etc... (dplug:core
package) for use with the runtime disabled - the middle ground
that's way more usable than -betterC. Th
On Thursday, 9 November 2017 at 12:19:00 UTC, Petar Kirov
[ZombineDev] wrote:
On Thursday, 9 November 2017 at 11:08:21 UTC, ParticlePeter
wrote:
Any experience reports or general suggestions?
I've used only D threads so far.
It would be far easier if you use druntime + @nogc and/or
de-registe
On Thursday, 9 November 2017 at 12:43:54 UTC, Petar Kirov
[ZombineDev] wrote:
On Thursday, 9 November 2017 at 12:30:49 UTC, rikki cattermole
wrote:
On 09/11/2017 12:19 PM, Petar Kirov [ZombineDev] wrote:
On Thursday, 9 November 2017 at 11:08:21 UTC, ParticlePeter
wrote:
Any experience reports
Any experience reports or general suggestions?
I've used only D threads so far.
On Monday, 22 May 2017 at 14:01:56 UTC, Jerry wrote:
IIRC the problem is that it isn't a POD type. ImVec2 has its
own default constructor. The problem now is that because it no
longer is POD, Window's ABI handles it different and doesn't
put the value in a register. Now with D is that you aren
On Monday, 22 May 2017 at 13:03:17 UTC, evilrat wrote:
On Monday, 22 May 2017 at 11:25:31 UTC, ParticlePeter wrote:
Then I am not getting your hack, this function here, does not
exist on the C++ side.
HACK ---
// extern(C++) of course
void GetCursorPos(ImVec2* v);
Ho
On Monday, 22 May 2017 at 08:25:45 UTC, evilrat wrote:
On Monday, 22 May 2017 at 08:03:07 UTC, ParticlePeter wrote:
No, no, this (other) way around :-), still C++ to D. It
actually works btw:
HACK ---
// original C++
ImVec2 GetCursorPos();
// C++ helper
void GetCurs
On Monday, 22 May 2017 at 07:24:20 UTC, evilrat wrote:
On Monday, 22 May 2017 at 06:33:37 UTC, ParticlePeter wrote:
On Monday, 22 May 2017 at 01:39:04 UTC, evilrat wrote:
And this is actually D problem. In fact first bug report on
this thing was dated back to 2014. Still not fixed.
Thanks
On Monday, 22 May 2017 at 01:39:04 UTC, evilrat wrote:
On Monday, 22 May 2017 at 01:27:22 UTC, Nicholas Wilson wrote:
Probably because the D side is expecting to have the struct
returned in a pointer allocated by the callee and then the C++
puts it in regs and BOOM.
If you wrap the C++ side
On Monday, 22 May 2017 at 01:27:22 UTC, Nicholas Wilson wrote:
On Sunday, 21 May 2017 at 19:33:06 UTC, ParticlePeter wrote:
I am statically linking to ImGui [1] on Win 10 x64, quite
successfully till this issue came up. The noticed error so far
comes when an ImGui function returns an ImVec2, a
On Sunday, 21 May 2017 at 19:58:32 UTC, Stefan Koch wrote:
On Sunday, 21 May 2017 at 19:33:06 UTC, ParticlePeter wrote:
I am statically linking to ImGui [1] on Win 10 x64, quite
successfully till this issue came up. The noticed error so far
comes when an ImGui function returns an ImVec2, a simp
I am statically linking to ImGui [1] on Win 10 x64, quite
successfully till this issue came up. The noticed error so far
comes when an ImGui function returns an ImVec2, a simple POD
struct of two float members. I can use this struct as argument to
functions but when it is returned from a functi
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 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 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 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 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;
}
***
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 Wednesday, 26 April 2017 at 08:24:08 UTC, Basile B. wrote:
On Tuesday, 25 April 2017 at 18:58:58 UTC, Ali Çehreli wrote:
On 04/25/2017 11:54 AM, Ali Çehreli wrote:
My analysis is wrong because that writefln() is for the
bar(float) overload but I still think what you want is
achieved.
Ali
On Tuesday, 25 April 2017 at 16:27:43 UTC, Basile B. wrote:
On Tuesday, 25 April 2017 at 15:43:48 UTC, ParticlePeter wrote:
On Tuesday, 25 April 2017 at 09:50:14 UTC, Basile B. wrote:
On Monday, 24 April 2017 at 16:46:21 UTC, ParticlePeter wrote:
Thanks for your reply, but that's what I would
On Tuesday, 25 April 2017 at 09:50:14 UTC, Basile B. wrote:
On Monday, 24 April 2017 at 16:46:21 UTC, ParticlePeter wrote:
I would like to have this kind of struct:
struct Foo {
private int i;
void function( int i, float f ) bar; // will be defined at
runtime
void bar( float f ) {
I would like to have this kind of struct:
struct Foo {
private int i;
void function( int i, float f ) bar; // will be defined at
runtime
void bar( float f ) {
bar( i, f );
}
}
But apparently the function pointer and the member function
cannot have the same name: Error: function m
On Tuesday, 26 July 2016 at 21:20:18 UTC, ParticlePeter wrote:
...
First of all there seems to be a typo, it should not be:
else static if(i + 1 == arg.length)
ignore must be used instead of arg, as arg.length is the length
of a string:
else static if(i + 1 == ignore.length)
if ignore is
On Tuesday, 26 July 2016 at 21:01:19 UTC, Ali Çehreli wrote:
On 07/26/2016 01:58 PM, ParticlePeter wrote:
On Tuesday, 26 July 2016 at 20:18:48 UTC, Steven Schveighoffer
wrote:
...
void processMember( T, ignore... )() {
foreach( member; __traits( allMembers, T )) { // this is a
compile-time l
On Tuesday, 26 July 2016 at 20:18:48 UTC, Steven Schveighoffer
wrote:
...
void processMember( T, ignore... )() {
foreach( member; __traits( allMembers, T )) { // this is a
compile-time list, so it's a static foreach.
foreach(i, arg; ignore ){ // i is the index into the ignore
tuple
On Tuesday, 26 July 2016 at 20:18:48 UTC, Steven Schveighoffer
wrote:
...
Thanks a lot for this really cool and detailed explanation
(upvoting!).
It's a bit weird to work on these compile-time things, but they
are so cool when you look at what is available in std.meta and
std.traits :)
Agr
On Tuesday, 26 July 2016 at 19:30:18 UTC, ParticlePeter wrote:
// Second approach, get warnings for every skipped member
// and every line after the return statement:
// Warning: statement is not reachable
void processMember( T, ignore... )() {
foreach( member; __traits( allMembers, T )) {
I want to generate one function for any struct data member, but
also want to be able to skip few of the members. The first part
works, but I have some trouble with the skipping.
I pass the struct type and a Compile-time Argument List of
strings as template arguments to a template function, lis
On Saturday, 23 July 2016 at 19:20:10 UTC, Jacob Carlborg wrote:
On 2016-07-23 14:27, ParticlePeter wrote:
Is there any kind of project or workflow that converts D
(subset) to
C/CPP ?
No idea about the status but:
https://github.com/adamdruppe/tools/blob/dtoh/dtoh.d
Thanks, I am looking in
On Saturday, 23 July 2016 at 12:29:45 UTC, rikki cattermole wrote:
On 24/07/2016 12:27 AM, ParticlePeter wrote:
Is there any kind of project or workflow that converts D
(subset) to
C/CPP ?
This probably will interest you for ldc:
http://stackoverflow.com/questions/5180914/llvm-ir-back-to-hum
Is there any kind of project or workflow that converts D (subset)
to C/CPP ?
On Tuesday, 7 June 2016 at 14:31:40 UTC, Alex Parrill wrote:
I don't think opCast gets called for implicit conversions; it
only gets called for explicit casts. I'll test it later.
It does for type bool, but I fear that's the only exception.
On Monday, 6 June 2016 at 20:32:23 UTC, Alex Parrill wrote:
They'd be the same type, since you would define the vulkan
functions to take these structures instead of pointer or
integer types.
It relies on a lot of assumptions about the ABI that make a raw
pointer work the same as a structure c
On Saturday, 21 May 2016 at 06:36:53 UTC, tsbockman wrote:
...
As an example, if VK_NULL_HANDLE only ever needs to be assigned
to opaque types on the D side (that is, types that serve only
as an ID or address for communicating with the C side), you
could do this:
private struct VkNullHandle
On Monday, 6 June 2016 at 18:33:36 UTC, ParticlePeter wrote:
On Monday, 6 June 2016 at 16:19:02 UTC, Alex Parrill wrote:
On Monday, 6 June 2016 at 09:43:23 UTC, ParticlePeter wrote:
In C NULL can be used as integer as well as null pointer.
Is there a way to create such a type in D?
The type sh
On Monday, 6 June 2016 at 16:19:02 UTC, Alex Parrill wrote:
On Monday, 6 June 2016 at 09:43:23 UTC, ParticlePeter wrote:
In C NULL can be used as integer as well as null pointer.
Is there a way to create such a type in D?
The type should have only one value which is obviously
(0/null).
A exte
On Monday, 6 June 2016 at 11:40:11 UTC, Anonymouse wrote:
On Monday, 6 June 2016 at 09:43:23 UTC, ParticlePeter wrote:
In C NULL can be used as integer as well as null pointer.
Is there a way to create such a type in D?
The type should have only one value which is obviously
(0/null).
A extern
In C NULL can be used as integer as well as null pointer.
Is there a way to create such a type in D?
The type should have only one value which is obviously (0/null).
A extern( C ) function should be able to take it as either one.
Overloaded enum pops into my mind as example:
enum NULL = 0;
enum
On Sunday, 29 May 2016 at 09:07:07 UTC, Jonathan M Davis wrote:
On Sunday, May 29, 2016 07:14:12 ParticlePeter via
Digitalmars-d-learn wrote:
Which of the op(Index) operators is responsible for enabling
this
kind of syntax?
Would it be possible to get it work with UFCS or would I have
to
Which of the op(Index) operators is responsible for enabling this
kind of syntax?
Would it be possible to get it work with UFCS or would I have to
wrap the array?
alias uint32_t = uint;
struct Offset() {
uint32_t x;
uint32_t y;
}
// Introspect with:
void printStructInfo( T )( T info ) {
import std.stdio : writefln;
foreach (memb; __traits(allMembers, T)) {
writefln(typeof(__traits(getMember, info, memb)).stringof);
}
}
// Result is uint
I
On Saturday, 21 May 2016 at 16:01:26 UTC, Stefan Koch wrote:
On Saturday, 21 May 2016 at 15:53:18 UTC, David wrote:
Hi,
I want to try to create a game using D. I'm a complete newbie
though (other than having C/C++ experience). Where would I
start? Does D have an openGL binding? I am assuming
I am failing to link statically to glfw library with deimos glfw.
The repo includes an example for glfw2. I downloaded the latest
glfw2.lib and tried build the example with -m64 and got these
errors:
C:\ ... \deimos-glfw>dmd GLFW.lib
examples/glfw2/openwindow/openwindow.d -m64
MSVCRT.lib(MSVCR
On Sunday, 1 May 2016 at 10:13:47 UTC, H. S. Teoh wrote:
On Sun, May 01, 2016 at 09:42:37AM +, ParticlePeter via
Digitalmars-d-learn wrote:
I am logging arbitrary POD struct types with member names and
data:
void printStructInfo( T )( T info ) {
foreach( i, A; typeof( T.tupleof
I am logging arbitrary POD struct types with member names and
data:
void printStructInfo( T )( T info ) {
foreach( i, A; typeof( T.tupleof )) {
enum attribName = T.tupleof[i].stringof;
writefln( "%s : %s", attribName, mixin( "info." ~ attribName
));
}
}
Is there is some other way
On Thursday, 31 March 2016 at 18:25:45 UTC, H. S. Teoh wrote:
On Thu, Mar 31, 2016 at 06:23:21PM +, ParticlePeter via
Digitalmars-d-learn wrote:
Example from docs:
string s = "hello!124:34.5";
string a;
int b;
double c;
formattedRead(s, "%s!%s:%s", &a, &b, &
Example from docs:
string s = "hello!124:34.5";
string a;
int b;
double c;
formattedRead(s, "%s!%s:%s", &a, &b, &c);
assert(a == "hello" && b == 124 && c == 34.5);
now changing the first formattedRead argument to a string literal:
formattedRead("hello!124:34.5", "%s!%s:%s", &a, &b, &c);
results
On Wednesday, 23 March 2016 at 20:00:55 UTC, wobbles wrote:
Again, totally untested, but I think logically it should work.
( No D compiler on this machine so it mightn't even compile :] )
Thanks Wobbles, I took your approach. There were some minor
issues, here is a working version:
auto mult
On Wednesday, 23 March 2016 at 15:23:38 UTC, Simen Kjaeraas wrote:
Without a bit more detail, it's a bit hard to help.
std.algorithm.splitter has an overload that takes a function
instead of a separator:
import std.algorithm;
auto a = "a,b;c";
auto b = a.splitter!(e => e == ';' ||
On Wednesday, 23 March 2016 at 14:20:12 UTC, Andrea Fontana wrote:
Any input => output example?
Sure, it is ensight gold case file format:
FORMAT
type: ensight gold
GEOMETRY
model: 1exgold2.geo**
VARIABLE
scalar per node: 1 Stress
On Wednesday, 23 March 2016 at 11:57:49 UTC, ParticlePeter wrote:
Stupid typos:
I need to parse an ascii
file
with multiple tokens. ...
...
to do this with a lazy result range and
without
new allocations.
I need to parse an ascii with multiple tokens. The tokens can be
seen as keys. After every token there is a bunch of lines
belonging to that token, the values.
The order of tokens is unknown.
I would like to read the file in as a whole string, and split the
string with:
splitter(fileString, [
On Sunday, 13 March 2016 at 20:28:33 UTC, JR wrote:
On Sunday, 13 March 2016 at 20:13:03 UTC, Basile B. wrote:
On Sunday, 13 March 2016 at 20:10:57 UTC, Basile B. wrote:
[...]
Basile beat me to it. Yes, ref const(Array!T) accessor.
http://dpaste.dzfl.pl/cb2bc5cf9917
Thank you very much, bo
I have a struct that privately warps an std.container.array. I
would like to return a read-only reference of this array, it
should not be duplicated. How can I do this?
Cheers, ParticlePeter
On Tuesday, 12 January 2016 at 17:03:49 UTC, Ali Çehreli wrote:
On 01/12/2016 08:55 AM, ParticlePeter wrote:
> I have a function "otherFunc" which takes a function with
lots of
> parameters as argument:
>
> void otherFunc( void function( ref int p1, float p2, ubyte
p3, ... ) mf );
Ok.
> otherF
On Tuesday, 12 January 2016 at 17:28:35 UTC, Marc Schütz wrote:
On Tuesday, 12 January 2016 at 16:55:48 UTC, ParticlePeter
wrote:
[...]
If I understand you correctly (not sure), you would like to
write `MF` so that you don't need to specify the parameters in
the lambda? That's not possible,
On Tuesday, 12 January 2016 at 16:22:48 UTC, ParticlePeter wrote:
Actually, I do use only one param, and not int as well, hence I
would like the parameter list to be part of the alias.
Your example works though.
This was confusing, lets start fresh:
I have a function "otherFunc" which takes
On Tuesday, 12 January 2016 at 16:00:37 UTC, Daniel Kozak wrote:
V Tue, 12 Jan 2016 15:41:02 +
ParticlePeter via Digitalmars-d-learn
napsáno:
I have a function type and variable and assign a function to
it:
void function( int i ) myFunc;
myFunc = void function( int i ) { myCode; }
How
On Tuesday, 12 January 2016 at 15:57:03 UTC, Marc Schütz wrote:
On Tuesday, 12 January 2016 at 15:41:02 UTC, ParticlePeter
wrote:
I have a function type and variable and assign a function to
it:
void function( int i ) myFunc;
myFunc = void function( int i ) { myCode; }
How would I declare an
I have a function type and variable and assign a function to it:
void function( int i ) myFunc;
myFunc = void function( int i ) { myCode; }
How would I declare an alias for void function( int i ) such that
the case above would work like this:
// alias MF = void function( int i ); // not work
On Monday, 11 January 2016 at 00:46:38 UTC, Jason Jeffory wrote:
...
OK, I'll give it a try. What about GLUT and WGL? Whats the
difference between them all and glfw? Are all these just OS
helpers to reduce the boilerplate code?
These kind of questions are best clarified on the OpenGL wiki.
htt
On Sunday, 8 November 2015 at 23:17:06 UTC, Jakob Ovrum wrote:
The closures for delegates in D1 are never automatically copied
to the heap, while in D2 this is done when it's determined that
the delegate might outlive one of its upvalues.
So, I think it's safe to say we have lexical closures i
Hi,
the confusion starts here: http://dlang.org/function.html#closures
End of paragraph bellow the last delegate example:
"This combining of the environment and the function is called a
dynamic closure."
While according to
https://en.wikipedia.org/wiki/Scope_%28computer_science%29
"Lexical sco
On Sunday, 6 September 2015 at 10:24:25 UTC, Marc Schütz wrote:
Untested:
struct Vector(T) {
T[42] data;
auto opDispatch(string func, Args...)(Args args)
if(is(typeof(mixin("data."~func)(Args.init))) && func
!= "length")
{
return mixin("data."~f
On Sunday, 6 September 2015 at 08:48:32 UTC, bioinfornatics wrote:
On Sunday, 6 September 2015 at 07:34:36 UTC, ParticlePeter
wrote:
I am working on a struct vector. The data is stored in a
member static array and I want to be able to forward all array
properties except length to vector.
Reason
I am working on a struct vector. The data is stored in a member
static array and I want to be able to forward all array
properties except length to vector.
Reason is I have free functions f that take vector(s) as
arguments, such that f(vector) and vector.f via UFCS is possible.
Using alias arra
On Wednesday, 17 June 2015 at 13:58:09 UTC, Kagamin wrote:
(&arr.front())[0 .. arr.length] ?
Yes, this works, nice, thanks :-)
On Wednesday, 17 June 2015 at 13:31:21 UTC, Marc Schütz wrote:
On Wednesday, 17 June 2015 at 13:04:28 UTC, ParticlePeter wrote:
I use wrapper functions taking void[] arrays to forward them
comfortably to mentioned OpenGL functions. This works with
static and dynamic build in arrays, but I don't
On Wednesday, 17 June 2015 at 13:07:11 UTC, Alex Parrill wrote:
On Wednesday, 17 June 2015 at 13:04:28 UTC, ParticlePeter wrote:
I use wrapper functions taking void[] arrays to forward them
comfortably to mentioned OpenGL functions. This works with
static and dynamic build in arrays, but I don'
I use wrapper functions taking void[] arrays to forward them
comfortably to mentioned OpenGL functions. This works with static
and dynamic build in arrays, but I don't see a way how I could
access (cast) the raw data of a std.container.array to forward it
to these wrapper functions. std.array(R
On Sunday, 7 June 2015 at 12:28:37 UTC, ParticlePeter wrote:
On Sunday, 7 June 2015 at 12:12:16 UTC, Rikki Cattermole wrote:
On 7/06/2015 11:53 p.m., ParticlePeter wrote:
Wow, sometimes tough to find a good subject and issue
description.
I am working on a dynamic binding to the mantle32.dll
fo
On Sunday, 7 June 2015 at 12:12:16 UTC, Rikki Cattermole wrote:
On 7/06/2015 11:53 p.m., ParticlePeter wrote:
Wow, sometimes tough to find a good subject and issue
description.
I am working on a dynamic binding to the mantle32.dll following
DerelictGL and DerelictCl.
Functions in the mantle dll
Wow, sometimes tough to find a good subject and issue description.
I am working on a dynamic binding to the mantle32.dll following
DerelictGL and DerelictCl.
Functions in the mantle dll use structs as argument types. I
would like to define those structs in a module
derelict.mantle.types ( as in
On Monday, 18 May 2015 at 09:23:26 UTC, tcak wrote:
On Monday, 18 May 2015 at 09:18:33 UTC, ParticlePeter wrote:
I get the point to an array from a c function, the data size
from another function. The data should be only readable at the
D side, but I would like to use it as a D slice without
c
I get the point to an array from a c function, the data size from
another function. The data should be only readable at the D side,
but I would like to use it as a D slice without copying the data.
Is this possible ?
1 - 100 of 112 matches
Mail list logo