Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] code assist and overloaded operator methods

Hi Nate,

thanks for your answer and I totally agree with you. However, your example 
shows 2 things. First, you're talking about class instances / objects, second 
you were using op as a prefix.

I generally have the problem that code completions can get overcrowded so I 
was wondering whether it would make sense to make the filter a bit more 
intelligent.

Meanwhile I've found CPPVisitor.findEnclosingFunctionOrClass() which could 
give me a hint whether we are in a scope where definitions are possible or 
not. Another check that I would find reasonable is for the prefix op.

Does that sound reasonable? I might try and write some patch.

thx Michi

On Thursday 29 May 2014 15:25:28 Nathan Ridge wrote:
> > I have a question whether code assists for overloaded operator methods
> > really make sense?
> > 
> > Writing A::operator=() only makes sense when I try to write the definition
> > for that method.
> 
> It might be useful to invoke code assist to see which overloaded operators
> are available on an object, as in:
> 
>   myobj.op  // invoke code assist here, see list of operators available for
> 'myobj'
> 
> Regards,
> Nate
> 
> 
> 
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top