As usual while waiting for the next release - don't forget to check the nightly builds in the forum.
//--------------MyException.h-----------------#include <string>class MyException{ public: virtual std::string getwhat() = 0;};class MyDivideZero : public MyException{ public: std::string getwhat() { return "Divide By Zero."; }};class MyTooLarge : public MyException{ public: std::string getwhat() { return "Too Large Number."; }};
//-------------------------main.cpp-----------------#include "MyException.h"#include <iostream>using namespace std; int main(){ try{ cout<<"It's a test."<<endl; }catch(MyException& e) { cout<<e.getwhat()<<"\n"; // code completion fails showing getwhat() method. After i write 'e.' ,it shows nothing. } }
//-----------------------StrInt.h-----------------#include <iostream>#include <string>class StrInt{ std::string _num; public: StrInt(const std::string& a = "0");};
//--------------------StrInt.cpp-----------------#include "StrInt.h"StrInt::StrInt(const std::string& a) : _num(a){ if (a.length()==0) ; // code completion fails showing length() method. After i write 'e.' ,it shows nothing.}
OK. i will do that. Wish the next stable release have a handy CC.
BTW,is there a real-time syntax error checking function(just like the eclipse cdt does) for C::B in the near future? It will be amazing.
#define String std::stringString str;str. < failandtypedef std::string String;String str;str. < fail[CodeBlocks svn 7789] P.S. CodeBlocks the best!