Why does XCode insert square brackets when I try to enter the C++ scope resolution operator, ::?

StackOverflow https://stackoverflow.com/questions/14971978

Pergunta

Given the following in-progress C++ code:

if (true)
    std

, as soon as I enter the first colon (:) of the scope resolution operator (::), XCode oddly inserts some square brackets, and my code looks like this:

if [(true)
    std:]

This is really annoying, and it can't figure out why it's doing it. At the moment it's doing it in some files but not others.

Foi útil?

Solução

It looks like it's trying to help you with Objective C syntax.

At a guess, the files where it's trying to do that have an extension indicating that what you're writing is Objective C. The files where it's not doing it are those that have an extension indicating that they contain C++ instead.

Outras dicas

It's trying to be nice and complete the Obj-C syntax.

object method

Adding a colon next turns into

[object methodWithParameter:(parameter) ]
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top