Constructor with Exception

if i have this:
1
2
3
4
5
6
7
8
9
10
class Number
{
private: int x;
public:
 Number(int _x):x(_x)
 {
  if (_x == 0)
   //what i do here? if i don't want 0?
 }
}


What is the best thing to do in this case? Exception? If it is, how i do it?
I don't want to construct the object if it is _x == 0.
thank you very much!
Topic archived. No new replies allowed.