<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://www.programmingexamples.net/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.programmingexamples.net/w/index.php?action=history&amp;feed=atom&amp;title=CPP%2FReturnByReference</id>
		<title>CPP/ReturnByReference - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.programmingexamples.net/w/index.php?action=history&amp;feed=atom&amp;title=CPP%2FReturnByReference"/>
		<link rel="alternate" type="text/html" href="http://www.programmingexamples.net/w/index.php?title=CPP/ReturnByReference&amp;action=history"/>
		<updated>2026-06-19T11:05:07Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.5</generator>

	<entry>
		<id>http://www.programmingexamples.net/w/index.php?title=CPP/ReturnByReference&amp;diff=2330&amp;oldid=prev</id>
		<title>Daviddoria: Created page with '==ReturnByReference.cpp== &lt;source lang=&quot;cpp&quot;&gt; #include &lt;iostream&gt; #include &lt;vector&gt; #include &lt;boost/graph/graph_concepts.hpp&gt;  class TestClass { public:   TestClass();      void …'</title>
		<link rel="alternate" type="text/html" href="http://www.programmingexamples.net/w/index.php?title=CPP/ReturnByReference&amp;diff=2330&amp;oldid=prev"/>
				<updated>2011-02-21T23:42:32Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;==ReturnByReference.cpp== &amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt; #include &amp;lt;iostream&amp;gt; #include &amp;lt;vector&amp;gt; #include &amp;lt;boost/graph/graph_concepts.hpp&amp;gt;  class TestClass { public:   TestClass();      void …&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==ReturnByReference.cpp==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;vector&amp;gt;&lt;br /&gt;
#include &amp;lt;boost/graph/graph_concepts.hpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class TestClass&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  TestClass();&lt;br /&gt;
  &lt;br /&gt;
  void OutputData();&lt;br /&gt;
&lt;br /&gt;
  double&amp;amp; GetElement();&lt;br /&gt;
  &lt;br /&gt;
private:&lt;br /&gt;
  std::vector&amp;lt;double&amp;gt; Data;&lt;br /&gt;
  &lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
double&amp;amp; TestClass::GetElement()&lt;br /&gt;
{&lt;br /&gt;
  return this-&amp;gt;Data[1];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
TestClass::TestClass()&lt;br /&gt;
{&lt;br /&gt;
  this-&amp;gt;Data.push_back(0);&lt;br /&gt;
  this-&amp;gt;Data.push_back(1);&lt;br /&gt;
  this-&amp;gt;Data.push_back(2);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void TestClass::OutputData()&lt;br /&gt;
{&lt;br /&gt;
  for(unsigned int i = 0; i &amp;lt; this-&amp;gt;Data.size(); i++)&lt;br /&gt;
    {&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; Data[i] &amp;lt;&amp;lt; &amp;quot; &amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
  TestClass test;&lt;br /&gt;
  test.OutputData();&lt;br /&gt;
  std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
  &lt;br /&gt;
  double&amp;amp; element = test.GetElement();&lt;br /&gt;
&lt;br /&gt;
  element = 5;&lt;br /&gt;
  &lt;br /&gt;
  test.OutputData();&lt;br /&gt;
  &lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==CMakeLists.txt==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cmake&amp;quot;&amp;gt;&lt;br /&gt;
cmake_minimum_required(VERSION 2.6)&lt;br /&gt;
&lt;br /&gt;
PROJECT(ReturnByReference)&lt;br /&gt;
&lt;br /&gt;
ADD_EXECUTABLE(ReturnByReference ReturnByReference.cpp )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Daviddoria</name></author>	</entry>

	</feed>