<p>Is there an elegant way to create and initialize a <code>const std::vector&lt;const T&gt;</code> like <code>const T a[] = { ... }</code> to a fixed (and small) number of values?<br>
I need to call a function frequently which expects a <code>vector&lt;T&gt;</code>, but these values will never change in my case.</p>

<p>In principle I thought of something like</p>

<pre><code>namespace {
  const std::vector&lt;const T&gt; v(??);
}
</code></pre>

<p>since v won't be used outside of this compilation unit.</p>

For C++11:
```
```
vector<int> luggage_combo = { 1, 2, 3, 4, 5 };
```
```
Original answer:
You would either have to wait for C++0x or use something like
Boost.Assign
to do that.
e.g.:
```
```
#include <boost/assign/std/vector.hpp>
using namespace boost::assign; // bring 'operator+=()' into scope

vector<int> v;
v += 1,2,3,4,5;
```
```