User forums > Using Code::Blocks

namespaces and code completion

<< < (2/2)

Alcareru:

--- Quote from: ollydbg on May 17, 2009, 04:50:08 pm ---
--- Quote from: Alcareru on May 17, 2009, 04:44:45 pm ---So what your saying is that there's no code completion for STL stuff?

--- End quote ---

No, I suggest you can just use "string" as it is in global scopes.

see something like this:


--- Quote ---#include <string>
using namespace std;
strin
// it should be work!


--- End quote ---

--- End quote ---

It doesn't. I modified the previous example a bit:
#include <string>
#include <iostream>

using namespace std;

namespace foospace {
    void fooMethod(){}
    class FooClass {};
    int foospaceVariable = 2;
}

int GLOBAL_FOO_VARIABLE = -1;

int main(int argc, char* argv[])
{
    foospace::fooMethod();
    foospace::FooClass fooClassInstance = foospace::FooClass();
    if (!(foospace::foospaceVariable == 2))
        throw 1;
    if (!(GLOBAL_FOO_VARIABLE == -1))
        throw 2;

    std::string fooString("fooStringText");

    string fooStringInstance = "foostring";//<- no code completion
    cout<<fooStringInstance<<endl;// <- no code completion for cout nor endl

/* Remove this line to uncomment the next if-clause
    if (foospaceVariable == 2) // <- code completion, though variable is not even visible
        throw 3;/**/
    return 0;
}

ollydbg:
Works fine in my XP and nightliy build.
See the screen shot below.

[attachment deleted by admin]

Alcareru:
Ok. I'll check the nightly build. Thanks.

Navigation

[0] Message Index

[*] Previous page

Go to full version