Author Topic: Code Completion Call Tip not working  (Read 10921 times)

Offline SimpleX

  • Single posting newcomer
  • *
  • Posts: 4
Code Completion Call Tip not working
« 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;
}
« Last Edit: November 23, 2018, 07:04:44 am by SimpleX »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Code Completion Call Tip not working
« Reply #1 on: November 22, 2018, 08:19:11 pm »
What happens if you don't use the wrong c-tor? :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline SimpleX

  • Single posting newcomer
  • *
  • Posts: 4
Re: Code Completion Call Tip not working
« Reply #2 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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Code Completion Call Tip not working
« Reply #3 on: November 23, 2018, 08:54:22 am »
Does it work if you write it with () instead of {}?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline SimpleX

  • Single posting newcomer
  • *
  • Posts: 4
Re: Code Completion Call Tip not working
« Reply #4 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.
« Last Edit: November 23, 2018, 03:23:56 pm by SimpleX »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6035
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Code Completion Call Tip not working
« Reply #5 on: November 23, 2018, 04:35:59 pm »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.