Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Contributions to C::B => Topic started by: SimpleX on November 22, 2018, 05:58:58 pm

Title: Code Completion Call Tip not working
Post by: SimpleX on November 22, 2018, 05:58:58 pm
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.
Code: cpp
#include <vector>
using namespace std;

int main()
{
    vector<int> vectorOne {233,3};
    vector<int> vectorTwo;
    vector<int> vectorThree = {1,2};
    return 0;
}
Title: Re: Code Completion Call Tip not working
Post by: oBFusCATed on November 22, 2018, 08:19:11 pm
What happens if you don't use the wrong c-tor? :)
Title: Re: Code Completion Call Tip not working
Post by: SimpleX on November 23, 2018, 07:07:27 am
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
Title: Re: Code Completion Call Tip not working
Post by: oBFusCATed on November 23, 2018, 08:54:22 am
Does it work if you write it with () instead of {}?
Title: Re: Code Completion Call Tip not working
Post by: SimpleX on November 23, 2018, 03:21:16 pm
Does it work if you write it with () instead of {}?

Code: cpp
vector<int> vectorS ({1,2,3});
//vector<int> vectorS (1,2,3);  is not a valid way.
Yes, it works that way.
Title: Re: Code Completion Call Tip not working
Post by: ollydbg on November 23, 2018, 04:35:59 pm
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/)