Top "Stdvector" questions

std::vector is a contiguous sequence container in the C++ standard library.

Initialisation of static vector

I wonder if there is the "nicer" way of initialising a static vector than below? class Foo { static std::vector&…

c++ static-members stdvector
'vector' in namespace 'std' does not name a type

I am developing a C++ application using CodeBlocks 10.05 on Debian 7.0.0. For some reason, the following code #include <iostream> …

c++ std stdvector
Setup std::vector in class constructor

I'm designing a class that has a std::vector<int> as an instance variable. I'm using a std::…

c++ constructor new-operator stdvector
Why doesn't C++ require a "new" statement to initialize std::vector?

/* bar.h */ class bar{ /* standard stuff omitted */ std::vector<my_obj*> foo; }; /* bar.cpp */ bar::bar(){ // foo = new …

c++ stl stdvector
How to shuffle a std::vector?

I am looking for a generic, reusable way to shuffle a std::vector in C++. This is how I currently …

c++ shuffle stdvector
STL vector: Moving all elements of a vector

I have two STL vectors A and B and I'd like to clear all elements of A and move all …

c++ stl stdvector
Best way to split a vector into two smaller arrays?

What I'm trying to do: I am trying to split a vector into two separate arrays. The current int vector …

c++ split fstream stdvector
vector::at vs. vector::operator[]

I know that at() is slower than [] because of its boundary checking, which is also discussed in similar questions like …

c++ stl stdvector
Converting between C++ std::vector and C array without copying

I would like to be able to convert between std::vector and its underlying C array int* without explicitly copying …

c++ c arrays stl stdvector
advantages of std::set vs vectors or maps

This may be a stupid question, I am quite new to C++ and programming in general. I wish to understand …

c++ stdvector stdmap stdset