  
- UID
- 1
- 威望
- 1240 点
- 金钱
- 24019 金币
- 点卡
- 317 点
|
1#
发表于 2012-7-25 10:54
| 只看该作者
valgrind and throw
- #include <stdexcept>
- #include <iostream>
- #include <vector>
- class ValgrindRuntimeError : public std::exception {
- public:
- /** Takes a character string describing the error. */
- ValgrindRuntimeError(char s[]) {
- _s=new char[strlen(s)];
- strcpy(_s, s);
- }
- virtual ~ValgrindRuntimeError() throw() {
- delete[] _s;
- }
- /** Returns a C-style character string describing the general cause of
- * the current error (the same string passed to the ctor). */
- virtual const char* what() const throw() {
- return _s;
- }
- private:
- char *_s;
- };
- int main() {
- ValgrindRuntimeError a(std::string("xxxx").c_str());
- throw a;
- }
复制代码 |
我是一个呼吸着现在的空气而生活在过去的人
这样的注定孤独,孤独的身处闹市却犹如置身于荒漠
我已习惯了孤独,爱上孤独
他让我看清了自我,还原了自我
让我再静静的沉思中得到快乐和满足
再孤独的世界里我一遍又一遍
不厌其烦的改写着自己的过去
延伸到现在与未来
然而那只是泡沫般的美梦
产生的时刻又伴随着破灭的到来
在灰飞烟灭的瞬间我看到的是过程的美丽
而不是结果的悲哀。。。
|
|