A
A
Alexander2014-04-28 11:26:12
Qt
Alexander, 2014-04-28 11:26:12

QT Creator - why doesn't intellisense "see" object functions and fields via C++11 auto type?

Hello.
The problem is the following, in QT Creator, intellisense does not "see" functions and fields of an object via the C++11 auto type.
Below is an example of code, in it, iter-> and then intellisense does not show anything, you have to write blindly.

for(auto iter=pingAddr.begin();iter!=pingAddr.end();iter++)
        {
                avrPing += iter->getResult().avrRTT; //вот тут после iter-> все написано в слепую.
                i++;
        }

I saw such a problem on StackOverflow, but I didn’t find a solution there, perhaps someone came across this problem and its solution.
Note:
C++11 is in the settings. The code works without problems. The compiler is selected by VS2010 (despite the fact that intellisense VS displays everything correctly), the problem is only with QT Creator.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lolshto, 2014-04-28
Obiedkov @aobiedkov

Well, it doesn't work. Even bug is wound up.
If you have std::vector<SomeValueType> pingAddr;, then you can write

for(auto iter=pingAddr.begin();iter!=pingAddr.end();iter++)
        {
                SomeValueType& v = *iter;
                avrPing += v.getResult().avrRTT; //автодополнение будет работать, 
                //а код все равно проще, чем если писать название типа вместо auto

                i++;
        }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question