title: Can I return NULL for vector<double> function?
body: <p>I have the following function:</p>
  
  <pre><code>/* Calculate if there is an intersection with given intial position and 
    direction */
  vector&lt;double&gt; intersection(vector&lt;double&gt; startPos, vector&lt;double&gt; direction)
  {
     if(there is intersection)
        return (intersection coordinates);
     else {
        return NULL;
     }
  } 
  </code></pre>
  
  <p>Could I do this and check against <code>NULL</code> if an intersection exists:</p>
  
  <pre><code>vector&lt;double&gt; v = intersection(pos, dir);
  if(v == NULL)
     /* Do something */
  else
     /* Do something else */
  </code></pre>
  
  <p>If this is not allowed/bad coding practice, what is another way I may go about this?</p>