Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


#ActualEddieV223

Posted 24 March 2013 - 09:32 PM

Lol all this topic has gone way off course, if you're pointing to stack memory use a naked pointer, there isn't any reason to use a shared_ptr in this case.  If you wanted to you could use a reference, but there isn't much benefit in that except some cleaner syntax, but then you can't null the reference if you needed to.

 

If I were you either use a smart pointer to an std::array ( using the heap ), or just pass the address ( naked pointer to ) your std::array or c style array ( on the stack ).


#6EddieV223

Posted 24 March 2013 - 08:13 PM

Lol all this topic has gone way off course, if you're pointing to stack memory use a naked pointer, there isn't any reason to use a shared_ptr in this case.  If you wanted to you could use a reference, but there isn't much benefit in that except some cleaner syntax, but then you can't null the reference if you needed to.

 

If I were you either use a smart pointer to an std::array ( using the heap ), or just pass the address ( naked pointer to ) your std::array or c style array ( on the stack ).


#5EddieV223

Posted 24 March 2013 - 08:12 PM

Lol all this topic has gone way off course, if you're pointing to stack memory use a naked pointer, there isn't any reason to use a shared_ptr in this case.  If you wanted to you could use a reference, but there isn't much benefit in that except some cleaner syntax, but then you can't null the reference if you needed to.

 

If I were you either use a smart pointer to an std::array ( using the heap ), or just pass the address ( naked pointer to ) your std::array or c style array.


#4EddieV223

Posted 24 March 2013 - 08:10 PM

Lol all this topic has gone way off course, if you're pointing to stack memory use a naked pointer, there isn't any reason to use a shared_ptr in this case.  If you wanted to you could use a reference, but there isn't much benefit in that except some cleaner syntax, but then you can't null the reference if you needed to.


#3EddieV223

Posted 24 March 2013 - 08:09 PM

Lol all this topic has gone way off course, if you're pointing to stack memory use a naked pointer, there isn't any reason to use a shared_ptr in this case.  If you wanted to you could use a reference, but there isn't much benefit in that except some cleaner syntax, but then you can't null the reference if you needed to.


#2EddieV223

Posted 24 March 2013 - 08:08 PM

Lol all this topic has gone way off course, if you're pointing to stack memory use a naked pointer, there isn't any reason to use a shared_ptr in this case.


PARTNERS