User forums > Using Code::Blocks

Code completion don't work perfectly in the latest version?

(1/3) > >>

c2q1989:
Version: 12.11 (windows)
OS: Windows 8 x64

    I found C::B Editor cannot provide code-assist showing members when typing symbols like dot(.), arrow(->).

    For example, supposing that I have defined "vector<double> vec;". If I wanna use vec.begin() or vec.size(), I must complete the latter part by myself, i.e. begin() or size(). No code-assist is provided.

    I am not sure whether this could be a bug? Expecting your answer. Thanks!

oBFusCATed:
Please provide an example which reproduces the problem. It works for me.
But keep in mind that parsing templates and macro-expansions is not fully implemented.

c2q1989:
I just began to learn C++ a few days ago. I find this problem occured when parsing templates.

I wonder why the bug haven't been fixed yet? No offense, but it seems to be strange. Other C++ IDE, like C-Free, could do this kind of job.

ollydbg:

--- Quote from: c2q1989 on February 16, 2013, 07:14:11 am ---I just began to learn C++ a few days ago. I find this problem occured when parsing templates.

I wonder why the bug haven't been fixed yet? No offense, but it seems to be strange. Other C++ IDE, like C-Free, could do this kind of job.

--- End quote ---
1, did you see this message:

--- Quote from: oBFusCATed on February 15, 2013, 08:48:47 am ---Please provide an example which reproduces the problem. It works for me.

--- End quote ---
Tell us the exact problem you have.

2, Parsing C++ is not easy, especially the the code contains templates. (search the forum, there are many topics about this issue)
Currently, no c::b devs have the time or ability to implement this, although you can help c::b by supplying patches. :)

c2q1989:
This example comes from Accelerated C++. I have underlined the problematic parts.

#include <algorithm>
#include <iomanip>
#include <ios>
#include <stdexcept>
#include <string>
#include <vector>
#include "grade.h"
#include "Student_info.h"

using std::cin;                          using std::setprecision;
using std::cout;                        using std::sort;
using std::domain_error;             using std::streamsize;
using std::endl;                         using std::string;
using std::max;                         using std::vector;

int main()
{
    vector<Student_info> students;
    Student_info record;
    string::size_type maxlen = 0;

    while (read(cin, record))
    {
        maxlen = max(maxlen, record.name.size());
        students.push_back(record);
    }

    // alphabetize the student records
    sort(students.begin(), students.end(), compare);

    // write the name and grades
    for (vector<Student_info>::size_type i = 0;
        i != students.size(); ++i)
    {
        // write the name, padded on the right to maxlen + 1 characters
        cout << students.name
             << string(maxlen + 1 - students.name.size(), ' ');
        // compute and write the grade
        try {
            double final_grade = grade(students);
            streamsize prec = cout.precision();
            cout << setprecision(3) << final_grade
                 << setprecision(prec);
        } catch (domain_error e) {
            cout << e.what();
        }
        cout << endl;
    }
    return 0;
}

Navigation

[0] Message Index

[#] Next page

Go to full version