█ █ void bar_0(); // function definition ██ void bar_0() // function declaration ██ void A::bar_1(int a); █ █ █ void bar_2(int a) █ █ █ █ █ █ {█ } █ void bar_3(int x, int y) █ █ { int a = 5; █ int b = 7; █ a = 135; list_for_each(item, list) { █ } █ /* c1 * c2 */ █ int x2; █ /* single comment */ █ // cpp comment std::for_each(a, b, [] (int& b) -> foo { █ b+=3; } A_function(parameter_for_A); █ █ } █
class foo : public my_Class █ █ { void bar_c(int t, int u) █ █ █ : t(222) , u(88) █ { █ typedef char CHAR; █ █ CHAR c; int a; int b; █ c = 'a'; █ switch (a) { █ case 0: b = 1; break; █ case 1: b = 5; break; █ case 13: { █ b = 15; break; } } █ █ do { █ do_something(); } while (!d.isEmpty()); ██ █ if (a) { █ b = 1; } else if (c) { █ █ █ b ; } else { █ b = 3; } █ █ for (a = 1; a < 5; a++) { █ b = b + a; } █ for (int a = 1; a < 5; a++) { █ b = a + 4; } try { █ b = 1; if (err) { █ throw std::runtime_error(std::string("nextKey: ") + err.asString()); } } catch (const std::exception &exc) { █ █ b = 3; } █ while (c) { █ b ; } █ } enum CaseOfOne { █ a1, b1, █ // comment c1, █ }; struct indent_ptr_t █ { chunk_t *ref; █ // comment int delta; █ } ipt; █ █ union UnionOfOne { █ a1, b1, █ // comment c1, █ }; █ █ private: // same for protected:, signal: or slots: label █ int ap; }; █
namespace foo { █ int foo() { if (foo) a++; return; █ █ if (a) return; █ l123: █ int a = 5; █ if (a > b) { c = 7; █ return a + b; } std::for_each(a, b, [] (int& b)->foo{ b+=3; return(b); }); █ QUrl dxOffEagle("http://something/newpage.html?[{\"foo: bar\"}]", QUrl::TolerantMode); █ █ return 0; █
/* c1 * */ █ void b(); █ void d(); #define LOG_CONTTEXT() \ █ LOG_FMT(LCONTTEXT \ ,"%s:%d set cont_text to '%s'\n" \ ,__func__, __LINE__, cmt.cont_text.c_str()) template <class T> █ ItemJob::ItemJob(PlatformDependent *internals, const QNetworkRequest &request) : GetJob(internals, request) typedef int ia; typedef int ib; █ typedef int ic; typedef int id;