由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - C++ 用户定义exception的标准用法是什么?
相关主题
工厂模式 (转载)关于isapi
一个VC++ .net里编译C程序的问题Continue feeling the pain
C++ interview programming exercisePartner needed (Web based service business)
关于微软的winrt (转载)How many people use design patterns when coding?
这些语言开发大型软件的可能性如何安装python for windows extensions
GCC 居然允许变量长度的向量《Tuscany SCA 实战》(Tuscany SCA in Action)英文文字版[PDF]
这里的人用BOOST都是用来做什么?这个可以算棺材上最后一颗钉子了吧
Why Google Chrome is so fast?json能取代xml么??????
相关话题的讨论汇总
话题: exception话题: class话题: error话题: c++话题: const
进入Programming版参与讨论
1 (共1页)
w***g
发帖数: 5958
1
不想自己定义一堆exception类.STL有没有什么可以直接用的,比如用下面的语句
throw SomeStandardException("something failed");
c**a
发帖数: 316
2
throw exception("ooooooops");

【在 w***g 的大作中提到】
: 不想自己定义一堆exception类.STL有没有什么可以直接用的,比如用下面的语句
: throw SomeStandardException("something failed");

w***g
发帖数: 5958
3
STL中的exception明显不能这么用.

【在 c**a 的大作中提到】
: throw exception("ooooooops");
c**a
发帖数: 316
4
无语了。

【在 w***g 的大作中提到】
: STL中的exception明显不能这么用.
t****t
发帖数: 6806
5
namespace std {
class logic_error;
class domain_error;
class invalid_argument;
class length_error;
class out_of_range;
class runtime_error;
class range_error;
class overflow_error;
class underflow_error;
}

【在 w***g 的大作中提到】
: STL中的exception明显不能这么用.
c**a
发帖数: 316
6
大牛啥意思?
这些都是 exception 的之类哇?
别说我错了。我都很没自信了。

【在 t****t 的大作中提到】
: namespace std {
: class logic_error;
: class domain_error;
: class invalid_argument;
: class length_error;
: class out_of_range;
: class runtime_error;
: class range_error;
: class overflow_error;
: class underflow_error;

t****t
发帖数: 6806
7
你当然错了, 把自己的代码试试编译一下总会的吧, 这还要人说?

【在 c**a 的大作中提到】
: 大牛啥意思?
: 这些都是 exception 的之类哇?
: 别说我错了。我都很没自信了。

c**a
发帖数: 316
8
....
完了。 彻底不会了。 我一直这么用的, 一直好好的哇。 不但编译过, 还测试过呢。
cout << "Enter length for array 1";
stringstream ss;
int i;
string s("hi I like u");
string::iterator it_begin = s.begin();
string::iterator it_end = s.end();
//printdoubletillq();

do
{
ss.clear();
cin >> s;
ss.str(s);

try{
if(!(ss >> i))


【在 t****t 的大作中提到】
: 你当然错了, 把自己的代码试试编译一下总会的吧, 这还要人说?
c**a
发帖数: 316
9
如题

呢。

【在 c**a 的大作中提到】
: ....
: 完了。 彻底不会了。 我一直这么用的, 一直好好的哇。 不但编译过, 还测试过呢。
: cout << "Enter length for array 1";
: stringstream ss;
: int i;
: string s("hi I like u");
: string::iterator it_begin = s.begin();
: string::iterator it_end = s.end();
: //printdoubletillq();
:

y*******g
发帖数: 6599
10
c++可以throw任何东西阿.
不一定要exception类的

【在 w***g 的大作中提到】
: 不想自己定义一堆exception类.STL有没有什么可以直接用的,比如用下面的语句
: throw SomeStandardException("something failed");

t****t
发帖数: 6806
11
你的编译器太次
拿gcc试试, 过不去的

呢。

【在 c**a 的大作中提到】
: ....
: 完了。 彻底不会了。 我一直这么用的, 一直好好的哇。 不但编译过, 还测试过呢。
: cout << "Enter length for array 1";
: stringstream ss;
: int i;
: string s("hi I like u");
: string::iterator it_begin = s.begin();
: string::iterator it_end = s.end();
: //printdoubletillq();
:

s******n
发帖数: 21
12
The constructors exception(const char * const &message) and exception(const
char * const &message, int) are Microsoft extensions to the Standard C++
Library.

【在 t****t 的大作中提到】
: 你的编译器太次
: 拿gcc试试, 过不去的
:
: 呢。

c**a
发帖数: 316
13
原来如此。。。

const

【在 s******n 的大作中提到】
: The constructors exception(const char * const &message) and exception(const
: char * const &message, int) are Microsoft extensions to the Standard C++
: Library.

1 (共1页)
进入Programming版参与讨论
相关主题
json能取代xml么??????这些语言开发大型软件的可能性
这里有做ServiceNow的朋友吗?GCC 居然允许变量长度的向量
Chomr/Firefox的extension能否往其他网站写数据?这里的人用BOOST都是用来做什么?
browser extension 的问题Why Google Chrome is so fast?
工厂模式 (转载)关于isapi
一个VC++ .net里编译C程序的问题Continue feeling the pain
C++ interview programming exercisePartner needed (Web based service business)
关于微软的winrt (转载)How many people use design patterns when coding?
相关话题的讨论汇总
话题: exception话题: class话题: error话题: c++话题: const