TypeScript --noImplicitAny is not enough!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Provides a mechanism to `inherit` a base class constructor | |
// verbatim (i.e., with the exact same parameter list) in a subclass. | |
// | |
// Note that in C++11 and onwards there's a better way to do it: | |
// See https://stackoverflow.com/questions/8093882/using-c-base-class-constructors | |
class Foo { | |
public: | |
#define FOO_CTOR(name, body, ...) \ | |
explicit name(int x, int y) \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.*.swp | |
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.stack-work | |
stack.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main | |
*.o |
g++ -std=c++11 main.cc
./a.out
http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Type_Erasure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
See main.c. Requires gcc or llvm-clang to compile. | |
$ time ./a.out --fast 40 | |
fibo(40) = 102334155 | |
real 0m0.571s | |
user 0m0.567s | |
sys 0m0.002s | |
$ time ./a.out --slow 40 | |
fibo(40) = 102334155 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
见 http://h.acfun.tv/t/4240594?r=4256785 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://www.zhihu.com/question/25037476/answer/30100671 |
NewerOlder