Initialising a vector in my structures constructor.

I have a c++ structure with an int vaulue and a vector.

I want to initialise the int and the vector like so:

1
2
3
4
5
6
7
8
9
10
11
12
13
	struct MyStruct
	{
		MyStruct(int myInt, int VectorInt) 
			: m_myInt(myInt)
   		        , m_VectorInt(VectorInt)

		{
		}

		int m_myInt;
		std::vector<int>m_VectorInt;
	
	};


I do the following:

 
MyStruct(100, 200);


I see that the m_myInt gets initialised but the m_VectorInt does not get its value pushed onto it.

How can I solve this problem.
It must be m_VectorInt(1,VectorInt)
Check the available constructors: http://www.cplusplus.com/reference/stl/vector/vector/
Topic archived. No new replies allowed.