Re: Semantic parses even if incorrect operator used

Eric Ludlam <[email protected]> Fri, 27 Feb 2015 20:50:13 -0500
Newsgroups gmane.emacs.semantic
Message-ID <[email protected]>
On 02/24/2015 04:12 PM, rjd wrote:
> Whether I create a pointer to a user defined object or instantiate a user
> defined object, I can interchangeably use the -> or . operators to access
> members/methods.
>
> === EXAMPLE ===
>
> #include <iostream>
>
> struct MyStruct
> {
>    MyStruct( void ) { }
>    ~MyStruct( void ) { }
>
>    int data;
>    int getData( void ) const { return data; }
> };
>
> int main( void )
> {
>    MyStruct* ms = new MyStruct();
>
>    ms. // works
>
>    return 0;
> }
>
> === END EXAMPLE ===

Yes, we don't bother checking the type of punctuation.  I figure the 
compiler should be good at that, and adding those checks in completion 
would just slow it down.

I suppose it would be cool if you typed "." and it converted it to "->" 
automatically if it could figure it out.   Probably wouldn't be too hard 
to figure out.

Eric

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/