<?xml version="1.0" encoding="utf-8"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>DaniWeb IT Discussion Community</title>
		<link>http://www.daniweb.com/forums/</link>
		<description>Tech support, programming, web development, and internet marketing community. Forums to get free computer help and support.</description>
		<language>en-US</language>
		<lastBuildDate>Tue, 01 Dec 2009 01:10:56 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.daniweb.com/alphaimages/misc/rss.jpg</url>
			<title>DaniWeb IT Discussion Community</title>
			<link>http://www.daniweb.com/forums/</link>
		</image>
		<item>
			<title>Set return issue with templated set.</title>
			<link>http://www.daniweb.com/forums/thread239612.html</link>
			<pubDate>Thu, 19 Nov 2009 01:51:54 GMT</pubDate>
			<description><![CDATA[Hey guys, 
 
I have this code snippet: 
 
template <typename ElementType, typename CompareClass> 
struct Delegate { 
	virtual bool geef(const ElementType &element){ 
		pair <set<ElementType, CompareClass>::iterator, bool> ret;  //this is line 196 
		ret = elements.insert(element); //197 
		return...]]></description>
			<content:encoded><![CDATA[<div>Hey guys,<br />
<br />
I have this code snippet:<br />
 <pre style="margin:20px; line-height:13px">template &lt;typename ElementType, typename CompareClass&gt;<br />
struct Delegate {<br />
&nbsp; &nbsp; &nbsp; &nbsp; virtual bool geef(const ElementType &amp;element){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pair &lt;set&lt;ElementType, CompareClass&gt;::iterator, bool&gt; ret;&nbsp; //this is line 196<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ret = elements.insert(element); //197<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return (ret.second); //198<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; virtual void output() = 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; set&lt;ElementType, CompareClass&gt; elements;<br />
};<br />
<br />
struct ArtiestenPrinter : public Delegate&lt;Lied, LiedCompare&gt; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; virtual bool geef(const Lied &amp;lied){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bool nieuwElement = Delegate&lt;Lied, LiedCompare&gt;::geef(lied); // 210<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (nieuwElement) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; lied.artiest;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return nieuwElement;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; virtual void output(){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for(set&lt;Lied, LiedCompare&gt;::iterator it = elements.begin();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; it != elements.end();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; it++){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; it-&gt;artiest &lt;&lt; endl;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
};</pre><br />
Which gives me these errors:<br />
 <pre style="margin:20px; line-height:13px">196: error: type/value mismatch at argument 1 in template parameter list for 'template&lt;class _T1, class _T2&gt; struct std::pair'<br />
196: error:&nbsp;  expected a type, got 'std::set&lt;ElementType,CompareClass,std::allocator&lt;_CharT&gt; &gt;::iterator'<br />
196: error: invalid type in declaration before ';' token<br />
198: error: request for member 'second' in 'ret', which is of non-class type 'int'<br />
210:&nbsp;  instantiated from here<br />
197: error: cannot convert 'std::pair&lt;std::_Rb_tree_const_iterator&lt;Lied&gt;, bool&gt;' to 'int' in assignment</pre><br />
I can't get my head around why the compiler is complaining, so any help is greatly appreciated.<br />
<br />
Thanks in advance,</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum8.html">C++</category>
			<dc:creator>Clockowl</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread239612.html</guid>
		</item>
		<item>
			<title>String assigns not permanent</title>
			<link>http://www.daniweb.com/forums/thread239599.html</link>
			<pubDate>Thu, 19 Nov 2009 00:21:34 GMT</pubDate>
			<description>Nevermind.</description>
			<content:encoded><![CDATA[<div>Nevermind.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum8.html">C++</category>
			<dc:creator>Clockowl</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread239599.html</guid>
		</item>
	</channel>
</rss>
