Call tip is not working for vectorOne nor it is being autocompleted by the codeblocks. No problem with vectorTwo or vectorThree.
I am using codeblocks 17.12 x86 on windows. C++11 is used.
#include <vector>
using namespace std;
int main()
{
vector<int> vectorOne {233,3};
vector<int> vectorTwo;
vector<int> vectorThree = {1,2};
return 0;
}
What happens if you don't use the wrong c-tor? :)
Quote from: oBFusCATed on November 22, 2018, 08:19:11 PM
What happens if you don't use the wrong c-tor? :)
There is nothing wrong with the constructor.
I have edited the question. Here are reference links (to show that the constructor is valid) :
https://en.cppreference.com/w/cpp/container/vector/vector
https://stackoverflow.com/questions/8906545/how-to-initialize-a-vector-in-c
Does it work if you write it with () instead of {}?
Quote from: oBFusCATed on November 23, 2018, 08:54:22 AM
Does it work if you write it with () instead of {}?
vector<int> vectorS ({1,2,3});
//vector<int> vectorS (1,2,3); is not a valid way.Yes, it works that way.
This is a know issue, see here:Code::Blocks / Tickets / #33 C++11 Initializer lists fool code completion (https://sourceforge.net/p/codeblocks/tickets/33/)