0

I saw the following class definition and cannot figure out the meaning of the line 1.

class Noisy {
public:
  Noisy() throw();
 ~Noisy() throw();
  Noisy& operator= (const Noisy&) throw();
  Noisy            (const Noisy&) throw(); // Line 1
};

What is the meaning of this line and what is the usage of this line?

Thank you

q0987
  • 34,938
  • 69
  • 242
  • 387

2 Answers2

7

It isn't a statement. It is a declaration of a copy constructor that is specified as throwing no exceptions.

You can find out more in your favorite good introductory C++ book.

Community
  • 1
  • 1
James McNellis
  • 348,265
  • 75
  • 913
  • 977
  • Sorry for this silly question. I should know that line if it was written as Noisy(const Noisy&) throw() -- Thank you – q0987 Dec 31 '10 at 04:13
0

Look at this thread. It will give you some more insight. Should I use an exception specifier in C++?

Community
  • 1
  • 1
santiagoIT
  • 9,411
  • 6
  • 46
  • 57