Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

convert "." to "->"

<< < (5/6) > >>

Loaden:

--- Quote from: oBFusCATed on August 27, 2010, 11:10:02 am ---Loaden, why, can you show an example?


--- Code: ---struct some_class { int get(); }
smart_ptr<some_class> p(new some_class);

p->  <--- I want to get the list with some_class's members
p.    <--- I want to get the list with smart_ptr's members


--- End code ---
And p.get() is pretty valid and I don't want to be rewritten to p->get()!

Please don't make me fight my IDE and make this option configurable :)



--- End quote ---

The variable 'p', it is *not* a pointer!
So, If we enter "p.", “." can not be changed to "->", because it's not pointers.

We need to judge what the back of the variable "p".
If there is a dot ("."), we need show smart_ptr's members.
else, we need show some_class's members.

killerbot:
how well did the . ==>  -> on regular pointers work ?

Could we have an up to date patch to try it out ?

oBFusCATed:

--- Quote from: Loaden on August 27, 2010, 10:58:28 am ---If we support smart pointer fully, we need this feature.

--- End quote ---
Why we need this feature? One reason please?
I've shown you, that this feature is pretty useless for smart pointers.

Don't try to make the IDE/CC too smart, you'll fail for sure,
because the IDE is not directly connected with the user's brain
and it doesn't know what he/she is thinking when doing something
and what are his/her intentions.

MortenMacFly:

--- Quote from: oBFusCATed on August 27, 2010, 01:15:03 pm ---Why we need this feature? One reason please?

--- End quote ---
I agree with oBFusCATed in this point. Especially trying to detect "smartly" if the user really means a pointer or not is really error prone. It's the job of the compiler to detect such kind of errors, not CC's.

Loaden:
Please waiting, I will try implement smart pointer parsing.
Currently, there does not need this feature.

If we really need this feature in future, it certainly can be configured, and is not selected default.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version