Am 13.10.2013 17:17, schrieb Artur Skawina:
On 10/13/13 16:43, Benjamin Thaut wrote:
Am 10.10.2013 17:45, schrieb Namespace:
On Thursday, 10 October 2013 at 15:15:45 UTC, bearophile wrote:
Namespace:
You mean like this?
void foo(T)(extern(C) void function(T*) func) {
}
That print
On 10/13/13 16:43, Benjamin Thaut wrote:
> Am 10.10.2013 17:45, schrieb Namespace:
>> On Thursday, 10 October 2013 at 15:15:45 UTC, bearophile wrote:
>>> Namespace:
>>>
You mean like this?
void foo(T)(extern(C) void function(T*) func) {
}
That print
Am 10.10.2013 17:45, schrieb Namespace:
On Thursday, 10 October 2013 at 15:15:45 UTC, bearophile wrote:
Namespace:
You mean like this?
void foo(T)(extern(C) void function(T*) func) {
}
That prints: Error: basic type expected, not extern
In theory that's correct, in practice the c
On Friday, 11 October 2013 at 15:55:17 UTC, Artur Skawina wrote:
It's probably not just "incompetence" (the compiler is able to
figure this
out in other contexts), but a deliberate choice. Having
function types
depend on their bodies would not be a good idea. Eg
int c;
auto f() {
On 10/10/13 20:54, Dicebot wrote:
> On Thursday, 10 October 2013 at 17:47:54 UTC, Namespace wrote:
>>
>> import std.stdio;
>>
>> void foo1(void function(void*) fp) { }
>> void foo2(void function(int) fp) { }
>> void foo3(void*) { }
>>
>> void main()
>> {
>> foo1((void* ptr) => ( assert(ptr
Andrej Mitrovic:
I'm pretty sure I saw it filed somewhere. Can't find it though..
I have just added the new test case :-)
http://d.puremagic.com/issues/show_bug.cgi?id=6754
Bye,
bearophile
On 10/10/13, bearophile wrote:
> Perhaps this bug is not yet in Bugzilla.
I'm pretty sure I saw it filed somewhere. Can't find it though..
On Thursday, 10 October 2013 at 17:47:54 UTC, Namespace wrote:
import std.stdio;
void foo1(void function(void*) fp) { }
void foo2(void function(int) fp) { }
void foo3(void*) { }
void main()
{
foo1((void* ptr) => ( assert(ptr is null) ));
foo2((int a) => ( a + 1 )); /// Fails: Erro
import std.stdio;
void foo1(void function(void*) fp) { }
void foo2(void function(int) fp) { }
void foo3(void*) { }
void main()
{
foo1((void* ptr) => ( assert(ptr is null) ));
foo2((int a) => ( a + 1 )); /// Fails: Error: function foo2
(void function(int) fp) is not callable using
Namespace:
/d917/f732.d(8): Error: basic type expected, not extern
/d917/f732.d(8): Error: semicolon expected to close alias
declaration
/d917/f732.d(8): Error: no identifier for declarator void
function(T*)
It seems that even the new alias syntax doesn't support the
extern :-) Perhaps this
On Thursday, 10 October 2013 at 15:15:45 UTC, bearophile wrote:
Namespace:
You mean like this?
void foo(T)(extern(C) void function(T*) func) {
}
That prints: Error: basic type expected, not extern
In theory that's correct, in practice the compiler refuses
tha
On Thursday, 10 October 2013 at 15:15:45 UTC, bearophile wrote:
Namespace:
You mean like this?
void foo(T)(extern(C) void function(T*) func) {
}
That prints: Error: basic type expected, not extern
In theory that's correct, in practice the compiler refuses
tha
On Thursday, 10 October 2013 at 14:44:00 UTC, Dicebot wrote:
On Thursday, 10 October 2013 at 14:40:09 UTC, Namespace wrote:
Example? I do not use lambdas often.
void foo(T)(void function(T*) test)
{
}
extern(C) void bar(int*) { }
void main()
{
foo( (int* a) => bar(a) );
}
I don't kn
Namespace:
You mean like this?
void foo(T)(extern(C) void function(T*) func) {
}
That prints: Error: basic type expected, not extern
In theory that's correct, in practice the compiler refuses that,
it's in Bugzilla, so try to define the type outside the signat
On Thursday, 10 October 2013 at 14:28:20 UTC, Dicebot wrote:
On Thursday, 10 October 2013 at 14:13:47 UTC, Namespace wrote:
I have this function:
void foo(T)(void function(T*) test) { }
And want to call it with a C function:
foo!(SDL_Surface)(SDL_FreeSurface);
but I get:
Fe
On Thursday, 10 October 2013 at 14:40:09 UTC, Namespace wrote:
Example? I do not use lambdas often.
void foo(T)(void function(T*) test)
{
}
extern(C) void bar(int*) { }
void main()
{
foo( (int* a) => bar(a) );
}
I don't know to what extent IFTI can work here though.
On Thursday, 10 October 2013 at 14:26:37 UTC, Benjamin Thaut
wrote:
Am 10.10.2013 16:13, schrieb Namespace:
I have this function:
void foo(T)(void function(T*) test) { }
And want to call it with a C function:
foo!(SDL_Surface)(SDL_FreeSurface);
but I get:
Fehler1Err
Am 10.10.2013 16:13, schrieb Namespace:
I have this function:
void foo(T)(void function(T*) test) { }
And want to call it with a C function:
foo!(SDL_Surface)(SDL_FreeSurface);
but I get:
Fehler1Error: foo (void function(SDL_Surface*) test) is not
callable using argu
On Thursday, 10 October 2013 at 14:13:47 UTC, Namespace wrote:
I have this function:
void foo(T)(void function(T*) test) { }
And want to call it with a C function:
foo!(SDL_Surface)(SDL_FreeSurface);
but I get:
Fehler 1 Error: foo (void function(SDL_Surface*) test) is not
c
I have this function:
void foo(T)(void function(T*) test) { }
And want to call it with a C function:
foo!(SDL_Surface)(SDL_FreeSurface);
but I get:
Fehler 1 Error: foo (void function(SDL_Surface*) test) is not
callable using argument types (extern (C) void
function(SDL_Surf
20 matches
Mail list logo