Jump to content

  • Log In with Google      Sign In   
  • Create Account


Red Ant

Member Since 14 Feb 2001
Offline Last Active Jun 17 2014 09:26 AM
-----

Posts I've Made

In Topic: Java vs C++ research paper

29 April 2012 - 04:37 AM

C++ compiler tends to destroy loop as everything is constant (volatile fixes that)


I'm sorry, but what do you mean by that?

In Topic: Segmentation fault on std::sort

25 April 2012 - 02:06 PM

Oops, sorry. Shame on me for not reading the whole thread before posting. Posted Image

In Topic: Segmentation fault on std::sort

24 April 2012 - 11:20 PM

And the debug call stack:

#0 00424842 SearchCell::get_f(this=0x0) (C:/Projects/Individuellt Mjukvaruutvecklingsprojekt/Game/DungeonsOfZiro/files/SearchCell.h:33)


Well, there's your problem. You're invoking the get_f() method on a null pointer.


EDIT: This means one of your operands in a call to bool cell_cmp::operator()(const std::shared_ptr<SearchCell>& a, const std::shared_ptr<SearchCell>& b) const is an empty shared_ptr.

In Topic: Refrences and Temporaries, or Why Does This Work?

24 April 2012 - 03:06 PM

Possibly it's an optimization causing object to be allocated on the local stack [...]


What optimization? Where else would it be "allocated" if not on the stack? Foo() creates a temporary. Of course it's on the stack.

In Topic: Refrences and Temporaries, or Why Does This Work?

24 April 2012 - 03:00 PM

Yup, it's simply just UNDEFINED BEHAVIOR. May actually appear to work some of the time, or it may cause your computer to explode. :)

PARTNERS