Search Results

Search found 1 results on 1 pages for 'vscharf'.

Page 1/1 | 1 

  • how-to initialize 'const std::vector<T>' like a c array

    - by vscharf
    Is there an elegant way to create and initialize a const std::vector<const T> like const T a[] = { ... } to a fixed (and small) number of values? I need to call a function frequently which expects a vector<T>, but these values will never change in my case. In principle I thought of something like namespace { const std::vector<const T> v(??); } since v won't be used outside of this compilation unit.

    Read the article

1