Original Post
Hi. Felt like saying that as it's my first post and all. I'm trying to figure out an easy way to automatically initialize all elements in a vector to a certain value. I've looked through a book I have on the standard library, and it looks like the only way to do it without looping through the whole vector and manually assigning a value is with a custom allocator. I'm sort of hoping there's an easier way than doing that, but if there isn't I'll just attempt to add an allocator. In case anyone wants to know the context, I'm trying to get a vector of pointers to initialize to zero. I'd also appreciate an example if anyone has the spare time and the knowledge.