<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Using integers in a C++ ArrayList</title>
	<link>http://www.yorkspace.com/2005/03/12</link>
	<description></description>
	<pubDate>Fri, 05 Sep 2008 20:25:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<item>
		<title>By: Nathaniel Zhu</title>
		<link>http://www.yorkspace.com/2005/03/12#comment-28627</link>
		<author>Nathaniel Zhu</author>
		<pubDate>Fri, 29 Aug 2008 17:46:17 +0000</pubDate>
		<guid>http://www.yorkspace.com/2005/03/12#comment-28627</guid>
		<description>Thanks, very useful code.</description>
		<content:encoded><![CDATA[<p>Thanks, very useful code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: outblu</title>
		<link>http://www.yorkspace.com/2005/03/12#comment-28613</link>
		<author>outblu</author>
		<pubDate>Thu, 31 Jul 2008 03:47:32 +0000</pubDate>
		<guid>http://www.yorkspace.com/2005/03/12#comment-28613</guid>
		<description>I'll try to figure out something in java ;)</description>
		<content:encoded><![CDATA[<p>I&#8217;ll try to figure out something in java <img src='http://www.yorkspace.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam Vander</title>
		<link>http://www.yorkspace.com/2005/03/12#comment-28603</link>
		<author>Sam Vander</author>
		<pubDate>Sat, 05 Jul 2008 21:43:35 +0000</pubDate>
		<guid>http://www.yorkspace.com/2005/03/12#comment-28603</guid>
		<description>Hey thanks for the help I'm going to try out the vector method looks easier.</description>
		<content:encoded><![CDATA[<p>Hey thanks for the help I&#8217;m going to try out the vector method looks easier.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://www.yorkspace.com/2005/03/12#comment-9</link>
		<author>Jason</author>
		<pubDate>Wed, 30 Mar 2005 18:09:37 +0000</pubDate>
		<guid>http://www.yorkspace.com/2005/03/12#comment-9</guid>
		<description>Yes, I can use the get_item(index) method instead of the iterator, but it still requires the boxing and casting.

You're also right about using the Array type to avoid the casting, but it is not dynamic.   The sized is fixed at compile time.

I'll have to try out your vector method, that may be just what I'm looking for.  Thanks!</description>
		<content:encoded><![CDATA[<p>Yes, I can use the get_item(index) method instead of the iterator, but it still requires the boxing and casting.</p>
<p>You&#8217;re also right about using the Array type to avoid the casting, but it is not dynamic.   The sized is fixed at compile time.</p>
<p>I&#8217;ll have to try out your vector method, that may be just what I&#8217;m looking for.  Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Schiller</title>
		<link>http://www.yorkspace.com/2005/03/12#comment-8</link>
		<author>Jeff Schiller</author>
		<pubDate>Tue, 29 Mar 2005 19:36:04 +0000</pubDate>
		<guid>http://www.yorkspace.com/2005/03/12#comment-8</guid>
		<description>Nope, WordPress ate my code.   std::vector should have a &#60; Int16 &#62; after it</description>
		<content:encoded><![CDATA[<p>Nope, WordPress ate my code.   std::vector should have a &lt; Int16 &gt; after it</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Schiller</title>
		<link>http://www.yorkspace.com/2005/03/12#comment-7</link>
		<author>Jeff Schiller</author>
		<pubDate>Tue, 29 Mar 2005 19:35:07 +0000</pubDate>
		<guid>http://www.yorkspace.com/2005/03/12#comment-7</guid>
		<description>I thought I'd try to post my Standard C++ version of your example for shiggles.  I'm assuming Int16 is either a typedef of "short", or a fully copyable C++ class.

&lt;code&gt;

Int16 Number;
std::vector Numbers;
std::vector::iterator it;

Number = 1;
Numbers.push_back(Number);

it = Numbers.begin();
while (it != Numbers.end() )
{
     Number = *it;
     ++it;
    // Do something with Number
}

&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I thought I&#8217;d try to post my Standard C++ version of your example for shiggles.  I&#8217;m assuming Int16 is either a typedef of &#8220;short&#8221;, or a fully copyable C++ class.</p>
<p><code></p>
<p>Int16 Number;<br />
std::vector Numbers;<br />
std::vector::iterator it;</p>
<p>Number = 1;<br />
Numbers.push_back(Number);</p>
<p>it = Numbers.begin();<br />
while (it != Numbers.end() )<br />
{<br />
     Number = *it;<br />
     ++it;<br />
    // Do something with Number<br />
}</p>
<p></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Schiller</title>
		<link>http://www.yorkspace.com/2005/03/12#comment-6</link>
		<author>Jeff Schiller</author>
		<pubDate>Tue, 29 Mar 2005 19:30:52 +0000</pubDate>
		<guid>http://www.yorkspace.com/2005/03/12#comment-6</guid>
		<description>Jason,

I don't know if I can post code in this comment so I won't even try lest WordPress mangle things...

I'll tell you up front that I've never used .NET.

Nonetheless, I tried to look at the class and it seems that you still have to do the box/cast combo though, since the ArrayList just holds Objects, ie it is not a strongly-typed container.  This is analagous to the non-templated versions of Java collections (tho Java 1.5 now supports specifying the type that the collection contains, afaik).  My flippant answer is:  Use std::vector and the square-brackets to access the elements :P  

But in talking with Rob, I know you guys are fully in bed with Microsoft at this point :P

Anyway, it seems that if you want to avoid using an iterator (i.e. if you just want to get at one value), you could save a little grief by just using the Item property, i.e. get_Item(index).

Is .NET's Array better for your application?  It seems that you can specify the Type of the Array and that might bypass a lot of the casting crap...

Regards,
Jeff</description>
		<content:encoded><![CDATA[<p>Jason,</p>
<p>I don&#8217;t know if I can post code in this comment so I won&#8217;t even try lest WordPress mangle things&#8230;</p>
<p>I&#8217;ll tell you up front that I&#8217;ve never used .NET.</p>
<p>Nonetheless, I tried to look at the class and it seems that you still have to do the box/cast combo though, since the ArrayList just holds Objects, ie it is not a strongly-typed container.  This is analagous to the non-templated versions of Java collections (tho Java 1.5 now supports specifying the type that the collection contains, afaik).  My flippant answer is:  Use std::vector and the square-brackets to access the elements <img src='http://www.yorkspace.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  </p>
<p>But in talking with Rob, I know you guys are fully in bed with Microsoft at this point <img src='http://www.yorkspace.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Anyway, it seems that if you want to avoid using an iterator (i.e. if you just want to get at one value), you could save a little grief by just using the Item property, i.e. get_Item(index).</p>
<p>Is .NET&#8217;s Array better for your application?  It seems that you can specify the Type of the Array and that might bypass a lot of the casting crap&#8230;</p>
<p>Regards,<br />
Jeff</p>
]]></content:encoded>
	</item>
</channel>
</rss>
