title: The difference between "Object *obj" and "Object &obj"
body: <p>graph.h</p>
  
  <pre><code>struct Edge {
      int from;
      int to;
      unsigned int id;
      Edge(): from(0), to(0), id(0) {};
  };
  
  struct Vertex {
      int label;
      vector&lt;Edge&gt; edge;
  };
  
  class Graph: public vector&lt;Vertex&gt; {
      int gid;
      unsigned int edge_size;
  };
  
  class Trans {
  public: 
      int tid;
      vector&lt;Graph&gt; graph;
  };
  </code></pre>
  
  <p><code>vector&lt;Trans&gt; database;</code> <code>database</code> is a global variable, then i call <code>run_algo(database);</code> in main function.</p>
  
  <pre><code>void run_algo(vector&lt;Trans&gt; &amp;db) {
      EdgeList edges;
      for(unsigned int tid = 0; tid &lt; db.size(); tid++) {
              Trans &amp;t = db[tid];
              ...
         Graph g = t.graph[gid];    
  </code></pre>
  
  <p>I want to ask <code>db</code> is a alias to <code>database</code>, <code>db[tid]</code> is a Transaction vector, but what if the difference between using <code>Trans &amp;t = db[tid];</code> and <code>Trans t = db[tid];</code>, since the author who write the sample using <code>Trans &amp;t = db[tid];</code>, but i think it should use <code>Trans t = db[tid];</code></p>
  
  <p>Thanks:)</p>