For example this code, 'p' is a pointer, and 'a' is a value.
If type "p." or "a.", they show the same results.
#include <iostream>
class A
{
public:
A();
~A();
void testMsg() {}
private:
int iLoveYou;
};
int main()
{
A* p = new A;
A a;
a.testMsg();
return 0;
}
Because CC can identified a pointer, or value, so we can do that:
If it is a pointer, then automatically replace from "." to "->", like this:
form:
p.testMsg();
to:
p->testMsg();
[attachment deleted by admin]
Useful, might I also suggest handling an accidental ',' as well?
*groans* I still remember spending trying to figure out a compiler error, over an x,y typo, after an 8~12 hour straight coding run.
blueshake has suggested that feature before, but there are objections.
Quote from: ollydbg on January 26, 2010, 02:57:42 AM
blueshake has suggested that feature before, but there are objections.
But such tips is clearly a very ridiculous!
p.testMsg();int main()
{
A* p = new A;
p.testMsg();
return 0;
}Both of "Qt Creator" and "Visual Assist X" selected from the "." To "->" conversion.
I hope CC team to re-consider this feature.
Thanks!
but how about the "smart pointer"?
std::auto_ptr<MyStruct> ap (new MyStruct());
ap. ?? //now the cc show thoese tips:
release()
get()
ap-> //show nothing.
Quote"Qt Creator"
@Loaden
since Qt Creator can do this , I think cc can do this in the future too. :D
Quote from: nanyu on January 26, 2010, 06:54:00 AM
but how about the "smart pointer"?
std::auto_ptr<MyStruct> ap (new MyStruct());
ap. ?? //now the cc show thoese tips:
release()
get()
ap-> //show nothing.
CC Doesn't support operator overloading