<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:osnews="http://www.osnews.com/rss2#">
	<channel>
		<title>OSNews: </title>
		<link>http://www.osnews.com/story/22050/Introducing_QScopedPointer</link>
		<description>Exploring the Future of Computing</description>
		<language>en-us</language>
		<copyright>Copyright 2001-2013, David Adams</copyright>
		<webMaster>adam+nospam@osnews.com</webMaster>
		<lastBuildDate>Sat, 25 May 2013 19:35:13 GMT</lastBuildDate>
		<image>
			<url>http://www.osnews.com/images/osnews.gif</url>
			<title>OSNews.com</title>
			<link>http://www.osnews.com</link>
		</image>
		<item>
			<title>Duplicated effort?</title>
			<link>http://www.osnews.com/thread?380357</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?380357</guid>
			<description>It looks to me like std::shared_ptr in the boost library does the same job. This is due to appear as a part of the standard in C++ 00x.<br />
<br />
OTOH, I'm not sure there is a simple way to make std::shared_ptr give up ownership of an object.</description>
			<pubDate>Mon, 24 Aug 2009 18:41:00 GMT</pubDate>
			<author>donotreply@osnews.com (Chicken Blood)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: Duplicated effort?</title>
			<link>http://www.osnews.com/thread?380360</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?380360</guid>
			<description>No, it's auto_ptr / auto_array.</description>
			<pubDate>Mon, 24 Aug 2009 18:47:00 GMT</pubDate>
			<author>donotreply@osnews.com (vivainio)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>its 2009</title>
			<link>http://www.osnews.com/thread?380410</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?380410</guid>
			<description>it's 2009 - why are we worrying about memory allocation in a high level language?</description>
			<pubDate>Mon, 24 Aug 2009 21:45:00 GMT</pubDate>
			<author>donotreply@osnews.com (project_2501)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: its 2009</title>
			<link>http://www.osnews.com/thread?380414</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?380414</guid>
			<description>Because C++ is useful to write high level languages while giving you full control of everything, including memory management.</description>
			<pubDate>Mon, 24 Aug 2009 22:08:00 GMT</pubDate>
			<author>donotreply@osnews.com (ebasconp)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: Duplicated effort?</title>
			<link>http://www.osnews.com/thread?380474</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?380474</guid>
			<description>This is mainly to provide better support for Qt on platforms like Symbian that would not have TR1/C++0x class library support.<br />
<br />
Boost has an ugly API and you can't dissect and pick one portion of the library separately to use. You have to include the whole Boost library as it is interdependent within itself.</description>
			<pubDate>Tue, 25 Aug 2009 07:10:00 GMT</pubDate>
			<author>donotreply@osnews.com (adkilla)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[2]: Duplicated effort?</title>
			<link>http://www.osnews.com/thread?380483</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?380483</guid>
			<description>It's *extremely* easy to cherry pick different parts of Boost and include them in your project. That's what 'bcp' is for, and it works like a charm. Yes, it  will pull in a lot of headers (partly because boost shares a lot of things, and otherwise because 'bcp' is conservative about what it includes), but the actual *code* it pulls in is minimal. Try doing this with another general purpose library (not even talking about the horrible Qt, which *does* pull in a lot of crap; now *that's* a heavy dependency).<br />
<br />
Boost has a horrible implementation (the price you pay for performance), but boost APIs are always very minimal. (what API is there to shared pointers anyway?) And who cares about ugly implementations if they are well tested and work?</description>
			<pubDate>Tue, 25 Aug 2009 08:03:00 GMT</pubDate>
			<author>donotreply@osnews.com (tramo)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Scoped Pointer</title>
			<link>http://www.osnews.com/thread?380503</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?380503</guid>
			<description>I thought it was a new rifle-sight attachment for the Wii Remote...</description>
			<pubDate>Tue, 25 Aug 2009 11:31:00 GMT</pubDate>
			<author>donotreply@osnews.com (3rdalbum)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: its 2009</title>
			<link>http://www.osnews.com/thread?380519</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?380519</guid>
			<description>Because, at some point, <i>someone</i> has to care about memory management.<br />
 <br />
 Qt generally handles memory management. A programmer writing a Qt application generally doesn't have to worry too much about it. Most objects do not need to be created with the new operator, so they are automatically destroyed when they go out of scope (end of function, or their containing object is destroyed). Most objects allocated on the heap have a clear owner - if you set the owner correctly, Qt will automatically destroy the object when it's owner is destroyed. Almost all of your memory management will be handled for you, either but C++ itself, or by Qt. There are some cases where it won't.<br />
 <br />
 The article describes a smart pointer implementation that's been added to Qt. There are pretty common in modern C++ - essentially, they enforce ownership policies, and destroy the referenced object when appropriate. There are many types of smart pointers, each of which has slightly different behaviour. Using these, a programmer doesn't have to bother with the actual nuts and bolts of memory management - you just tell the compiler how to manage it, and let it handle everything for you.<br />
 <br />
 Memory management can still cause problems in garbage collected languages like Java or .NET. That's why .NET has separate finalizers and the IDisposable interface, why C# has the <i>using</i> keyword, why they both have weak references, and so on. There are a multitude of ways to create memory leaks or resource leaks in a garbage collected languages, and it can often be very difficult to work out where the leaks are coming from.<br />
 <br />
 Sure, you can write Java / .NET code while being completely ignorant of memory management. The garbage collector will save you from some problems (objects being destroyed while still referenced, and dealing with shared ownership), but it will not (and can not) prevent memory leaks, or excessive memory usage. You need to be just as careful writing a large Java / .NET application as you do writing a large C++ application.Edited 2009-08-25 13:39 UTC</description>
			<pubDate>Tue, 25 Aug 2009 13:38:00 GMT</pubDate>
			<author>donotreply@osnews.com (ba1l)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>More explanation</title>
			<link>http://www.osnews.com/thread?380521</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?380521</guid>
			<description>Nice explanation about smart pointer classes in Qt.<br />
<a href="http://labs.trolltech.com/blogs/2009/08/25/count-with-me-how-many-smart-pointer-classes-does-qt-have/" rel="nofollow">http://labs.trolltech.com/blogs/2009/08/25/count-with-me-how-many-s...</a></description>
			<pubDate>Tue, 25 Aug 2009 14:19:00 GMT</pubDate>
			<author>donotreply@osnews.com (leos)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>WTF is this news?</title>
			<link>http://www.osnews.com/thread?380602</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?380602</guid>
			<description>WTF is this newsworthy? A scoped pointer is one of the most basic elements of RIIA-based C++ programming, any decent programmer knows how to implement it or use std::auto_ptr, boost::scoped_ptr or any of the 400 gazillion variations available EVERYWHERE.<br />
<br />
No, I can't stress this enough, this is the most retarded piece of news I've seen here in a while.</description>
			<pubDate>Tue, 25 Aug 2009 22:26:00 GMT</pubDate>
			<author>donotreply@osnews.com (fernandotcl)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: its 2009</title>
			<link>http://www.osnews.com/thread?380690</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?380690</guid>
			<description>Who says C++ is a high-level language? C++ is used in embedded systems where latency is important and memory is tight.<br />
 One of the nice (or scary, depending on your point of view) things about C++ is that it can be as high- or low-level as you wish it to. Depending on the features of the language that you use in your code, C++ can be used to write very low-level code adhering to both speed and size constraints.Edited 2009-08-26 14:08 UTC</description>
			<pubDate>Wed, 26 Aug 2009 14:07:00 GMT</pubDate>
			<author>donotreply@osnews.com (elahav)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[2]: Duplicated effort?</title>
			<link>http://www.osnews.com/thread?380970</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?380970</guid>
			<description>You definitely can cherry-pick parts. That's exactly what, for example, Phusion Passenger does.Edited 2009-08-27 16:57 UTC</description>
			<pubDate>Thu, 27 Aug 2009 16:56:00 GMT</pubDate>
			<author>donotreply@osnews.com (FooBarWidget)</author>
			<category>Comments</category>
		</item>
	</channel>
</rss>
