title: Construct std::set from array
body: <p>Why doesn't C++ provide us with a constructor which takes an array as an argument? Alternatively, is there anything wrong with defining the following function?</p>
  
  <pre><code>template &lt;class T&gt;
  std::set&lt;T&gt; ArrayToSet(T array[]) {
    return std::set&lt;T&gt;(array, array + sizeof(array) / sizeof(array[0]));
  }
  </code></pre>
  
  <p>I think the answer might come down to ideas of dynamic memory allocation, but I'd like to hear some feedback on this.</p>
  
  <p><strong>Edit:</strong> I am not using C++11.</p>