On Thursday, 29 December 2011 at 20:08:45 UTC, bls wrote:
import std.stdio;
import std.functional;
int main(string[] argv)
{
extern(Windows) int delegate( int i) dg;
alias dg callback;
callback = toDelegate(&test);
On Thu, Dec 29, 2011 at 7:16 PM, Jonathan M Davis wrote:
>
> A D exit function would have to do essentially the same thing as throw an
> exception and catch it in main anyway. The only way that the stack is going to
> be unwound properly is if you actually unwind it. The only way in the language
>
On Thursday, December 29, 2011 13:43:36 Ashish Myles wrote:
> On Thu, Dec 29, 2011 at 1:26 PM, Andrej Mitrovic
>
> wrote:
> > Probably the easiest thing to do is to throw a custom exception and
> > catch it somewhere in main() to return your status code. Unlike
> > exit(), throwing will take care
On 12/28/2011 03:45 PM, Tal wrote:
Can I do something like this :
__
extern (Windows) LRESULT delegate (HWND hWnd, UINT message, WPARAM wParam,
LPARAM lParam) MyWinProcDelegate;
this() {
MyWinProcDelegate =&Events;
}
ex
On 12/29/2011 12:43 PM, Ashish Myles wrote:
On Thu, Dec 29, 2011 at 1:26 PM, Andrej Mitrovic
wrote:
Probably the easiest thing to do is to throw a custom exception and
catch it somewhere in main() to return your status code. Unlike
exit(), throwing will take care of RAII stuff.
Thanks, Andre
On 12/21/2011 10:20 PM, Froglegs wrote:
>
>>> Which returned me a nice fat null pointer.. wth? Perhaps that should
>>> be a compile time error if you aren't supposed to use classes..
>>
>> Strange... I'm not sure what the deal is with that overload. I meant
>> the last one on the page (that takes
On Thu, 29 Dec 2011 08:01:51 +, Adrian Mercieca wrote:
> Hi folks,
>
> I've got this very simple program, for which I keep getting compiler
> errors at the 'cas' function call.
>
> import
> std.stdio,
> core.atomic;
>
> class Int
> {
> public:
> this(int v) {
>
On 12/28/2011 03:45 PM, Tal wrote:
Can I do something like this :
__
extern (Windows) LRESULT delegate (HWND hWnd, UINT message, WPARAM wParam,
LPARAM lParam) MyWinProcDelegate;
this() {
MyWinProcDelegate =&Events;
}
ex
On 12/28/2011 03:45 PM, Tal wrote:
Can I do something like this :
__
extern (Windows) LRESULT delegate (HWND hWnd, UINT message, WPARAM wParam,
LPARAM lParam) MyWinProcDelegate;
this() {
MyWinProcDelegate =&Events;
}
ex
On 12/28/2011 03:45 PM, Tal wrote:
Can I do something like this :
__
extern (Windows) LRESULT delegate (HWND hWnd, UINT message, WPARAM wParam,
LPARAM lParam) MyWinProcDelegate;
this() {
MyWinProcDelegate =&Events;
}
ex
On 2011-12-29 18:22, Jakob Ovrum wrote:
On Thursday, 29 December 2011 at 16:27:33 UTC, Ashish Myles wrote:
std.c.stdlib.exit() seems to break RAII. The code below tests this
both using a struct destructor and an explicit scope(exit) {}. Is
this an intentional feature or a bug?
import std.stdio;
On Thu, Dec 29, 2011 at 1:26 PM, Andrej Mitrovic
wrote:
> Probably the easiest thing to do is to throw a custom exception and
> catch it somewhere in main() to return your status code. Unlike
> exit(), throwing will take care of RAII stuff.
Thanks, Andrej. That option had occurred to me, but I fi
Probably the easiest thing to do is to throw a custom exception and
catch it somewhere in main() to return your status code. Unlike
exit(), throwing will take care of RAII stuff.
On Thu, Dec 29, 2011 at 12:22 PM, Jakob Ovrum wrote:
> On Thursday, 29 December 2011 at 16:27:33 UTC, Ashish Myles wrote:
>>
>> std.c.stdlib.exit() seems to break RAII. The code below tests this
>> both using a struct destructor and an explicit scope(exit) {}. Is
>> this an intentional feature or
On Thursday, 29 December 2011 at 17:22:33 UTC, Jakob Ovrum wrote:
Calling 'exit' doesn't properly shut down the D runtime either,
it's not just constructors.
I mean destructors*.
On Thursday, 29 December 2011 at 16:27:33 UTC, Ashish Myles wrote:
std.c.stdlib.exit() seems to break RAII. The code below tests
this
both using a struct destructor and an explicit scope(exit) {}.
Is
this an intentional feature or a bug?
import std.stdio;
import std.c.stdlib;
void main()
{
std.c.stdlib.exit() seems to break RAII. The code below tests this
both using a struct destructor and an explicit scope(exit) {}. Is
this an intentional feature or a bug?
import std.stdio;
import std.c.stdlib;
void main()
{
struct SafeExit {
~this() {
writeln("Safely exit
On 25.12.2011 11:28, Denis Shelomovskij wrote:
OK. As I wrote: "Yes, this allocation sometimes can be optimized out but
not always.". Consider this:
---
void main()
{
int[] a = new int[5];
void f(int[] b)
{
// Here we assume that b is unchanged a.
// As these array differ we need a copy.
assert(b
Hi folks,
I've got this very simple program, for which I keep getting compiler errors at
the 'cas' function call.
import
std.stdio,
core.atomic;
class Int
{
public:
this(int v) {
this._v = v;
}
private:
int _v;
}
void main()
{
s
19 matches
Mail list logo