C++ 代码风格一览
最近的项目中需要统一代码风格,搜素了一些著名项目的,罗列如下,以备参考。
其他:
都值得一看。
TinyC 把 C 代码当脚本运行的编译器
主页:
http://bellard.org/tcc/
介绍文章:
http://www.ibm.com/developerworks/cn/linux/l-tinyc/part1/
像这样:
#!/usr/bin/tcc -run -L/usr/X11R6/lib -lX11
#include <stdlib.h>
/* Yes, TCC can use X11 too ! */
#include <stdio.h>
#include <X11/Xlib.h>
int main(int argc, char **argv)
{
Display *display;
Screen *screen;
display = XOpenDisplay("");
if (!display) {
fprintf(stderr, "Could not open X11 display\n");
exit(1);
}
printf("X11 display opened.\n");
screen = XScreenOfDisplay(display, 0);
printf("width = %d\nheight = %d\ndepth = %d\n",
screen->width,
screen->height,
screen->root_depth);
XCloseDisplay(display);
return 0;
}
#include <stdlib.h>
/* Yes, TCC can use X11 too ! */
#include <stdio.h>
#include <X11/Xlib.h>
int main(int argc, char **argv)
{
Display *display;
Screen *screen;
display = XOpenDisplay("");
if (!display) {
fprintf(stderr, "Could not open X11 display\n");
exit(1);
}
printf("X11 display opened.\n");
screen = XScreenOfDisplay(display, 0);
printf("width = %d\nheight = %d\ndepth = %d\n",
screen->width,
screen->height,
screen->root_depth);
XCloseDisplay(display);
return 0;
}
C++永久对象存储
Persistent Object Storage for C++
"POST++ provides a simple persistent storage for your application, making your objects persistent with no overhead on accessing objects at runtime."
文档: http://www.garret.ru/post/readme.htm
在考虑存储 c++ 对象的问题,所以找到了这个。对于 Python 中的永久对象存储,有 Zope 中的 ZODB,非常强大。