Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where did `throw(...)` syntax come from?

Tags:

c++

history

In our application we had a handful of (member, but that shouldn't matter) functions declared as

void SomeFunction(Type argument) throw (...);

With Microsoft Visual C++ that compiles just fine. But now I am trying to compile it with GCC and it rejects the ... as syntax error. I remember hearing about this construct long ago, but looking at the specification neither C++03 nor C++11 seems to allow ... there and I can't remember where I got it from. Does anybody know anything about origin of this (clearly pointless) construct?

like image 694
Jan Hudec Avatar asked Oct 17 '12 18:10

Jan Hudec


1 Answers

From the article at http://msdn.microsoft.com/en-us/library/wfa0edys(v=vs.80).aspx:

"Visual C++ departs from the ANSI Standard in its implementation of exception specifications."

like image 181
Johan Avatar answered Oct 20 '22 00:10

Johan