• Forum
  • Lounge
  • Is it always necessary to make default c

 
Is it always necessary to make default constructor for a class?

Is there a reason to always make a default, or no parameter constructor? If so what convenient purpose does it serve? I'm writing a graph class right now and I'm wondering why I would ever want to use an object with all values meaningless?
You only need a default constructor if you want your class to be default-constructible. Some containers and functions require this, others don't.
Topic archived. No new replies allowed.