title: Rcpp - how to check if any attribute is NULL
body: <p>I have a <code>Rcpp</code> function that accepts a NumericMatrix and returns a NumericVector. In my code I have a line based on recommendations by Kevin Ushey here: <a href="https://stackoverflow.com/questions/24393025/in-rcpp-how-to-return-a-vector-with-names">In Rcpp - how to return a vector with names</a> that assigns column names of the NumericMatrix to the NumericVector :</p>
  
  <p><code>out.attr("names")=VECTOR_ELT(inp.attr("dimnames"),1)</code></p>
  
  <p>This code gives an error if the NumericMatrix didn't have column names, i..e <code>colnames(inp)=NULL</code>. How can I check in <code>Rcpp</code> if the <code>VECTOR_ELT(inp.attr("dimnames"),1)</code> is <code>NULL</code>?</p>