- 博客(4)
- 收藏
- 关注
原创 Definition of friend functions inside a namespace
A.h #ifndef _A_H_ #define _A_H_ #include // A.h using namespace std; namespace test{ class A{ public: friend ostream &operator<<(ostream &cout, const A &a); }; } #endif A.cpp #in
2014-03-24 21:31:36 455 2
原创 Unexpected Result from Calling a Non-static Function with class::method()
The static keyword, which does not exist in PHP 4, is imported since PHP 5. And there's also a new usage (PHP 5.3) static::method(), which enables a method derived from a parent class to call methods
2013-04-14 15:59:47 628
原创 Hidden Danger of References inside a Foreach Construct
In order to be able to directly modify array elements within the loop precede $value with &. In that case the value will be assigned by reference. That's a fact we've known for years. But I don't u
2013-04-12 22:11:33 393
原创 An unexpected output caused by misunderstood non-greedy mode of regular expression in PHP
Recently I've been working on a PHP project with my old small framework, parts of which, including the template engine, are from Discuz!. An unexpected output from the template engine surprised me.
2013-04-12 00:02:51 456
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人