// FILE: testa.h
#include "MySpace.h"
using namespace MySpace;
// << Here the code completition will see all the classes inside MySpace.
// FILE: testb.h
#include "testa.h" // << THIS FILE HAS INSIDE: using namespace MySpace
// << Here the code completition will see NONE of the MySpace classes, although you are using the namespace as declared at testa.h
/*
bla bla bla
*/
using namespace MySpace; // Ok we redeclare it
// << From this point CC will work fine with MySpace members.
Good job on the file search.
Just one more teeny teeny teeny suggestion...
When a string is found in one or more files, C::B seems to open the first in the results by default.
Would it not make sense to not open any file by default if there are more than one files found containing the search string? Or perhaps don't open any file at all until the user double clicks a result. I say this because C::B does not know which file the user wants to open/examine where there are multiple [file] matches.
Just a thought. :)
actually it is correct, as long as you don't say using namespace MySpace; the functions are not in the scope of the compiler (yes, saying compiler here, because it's c++ feature). In such a case you have to specifcy manually like : std::cout. So more or less it's a good thing the CC is also hiding it.
Sry I didn't understand :shock: (no offend, just my english isn't that good)... Is there a specification that says "using namespace" has effect only in the scope of file that is declared? Because at least with gcc, that isn't true. You can include other files that specify "using namespace" and this have effect at the end-file too.
No, there's no such specification. It's just that adding "using namespace" inside header files is considered bad practice. Think about it: if you do that in a header then all files including it, directly or (god forbid) indirectly, will be using that namespace too. This is namespace littering and is what namespaces were invented to avoid ;).
CC doesn't parse included files for "using namespace" keywords.
Yeah, probably you are right about my programming tactics, and maybe I 'll change them. But its different what should everyone do and what the compilers can do. What am I saying is, if compilers DO parse recursively for "using bla bla", why CC must be limited?
In my opinion it should be parsed, although I may never use it in the future as your arguments where good enough :P
Hi There,
Is it possible to save the file highlighting information from the edit menu options in the c::b project?
At the moment, it's nice to have my makefile syntax highlighted, but I have to manually set the highlighting every time I open the project.
Best Regards,
Brian Sidebotham.
Hmm does your makefile have an extension? Like .mak? Or is it named Makefile????? A lexer is applied to a doc based on the extension AFAIK. So if your makefile doesn't have something like a .mak extension then you will have to manually set it every time.
Highlighting Mode and File Encoding perhaps are better in the .layout, not the .cbp. Altrough it's debatable which one is better, either is better than nothing.Hmm does your makefile have an extension? Like .mak? Or is it named Makefile????? A lexer is applied to a doc based on the extension AFAIK. So if your makefile doesn't have something like a .mak extension then you will have to manually set it every time.
It has no extension. The setting is manual, from the Edit menu, and you can apply anything you want to a file with an 'unrecognised' extension. If the extension is unrecognised, it would be beneficial for c::b to remember any highlighting information for that file in the cbp
Hello all,
I experience some troubles for quite some time now regarding windows shutdown and codeblocks crash. When I shutdown my computer and codeblocks is still running, codeblocks always crash even when you are prompted to save your work. Saving works but codeblocks crashes afterwards. No problem closing codeblocks normally (not forced by a windows shutdown)
Any ideas?
Jan
Hello all,
I experience some troubles for quite some time now regarding windows shutdown and codeblocks crash. When I shutdown my computer and codeblocks is still running, codeblocks always crash even when you are prompted to save your work. Saving works but codeblocks crashes afterwards. No problem closing codeblocks normally (not forced by a windows shutdown)
Any ideas?
Jan
I can confirm that on Windows XPsp2, shutting down with CB open (SVN 3001 and prior) causes CB to crash and hangs the shutdown.
I'll see if I can get a backtrace on this.
#define SLIB_DECLARE_EXCEPTION(name, type) \ // << A there is a bug at forums C++ format plugin too :P
class name : public Exception { \
public : name (int error, const string desc, const string func, const string file, long line) \
: Exception(error, desc, func, file, line, type) {} }; \
#include "testa.h"
// MyException1 declared with normal way
class MyException1 : public Exception
{
public :
MyException1(int error, const string desc, const string func, const string file, long line)
: Exception(error, desc, func, file, line, "MyException1")
{}
};
// MyException2 Declared using my macro
SLIB_DECLARE_EXCEPTION(MyException2, "MyException2");
// <<< Here code completition sees only MyException1
Is it possible to be implemented, or it is too complicated?