KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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.
Tags (comma-separated)
Save Edits
Cancel