www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Why are constructor definitions are preserved in interface files?

module lib.a;

class C {

	this() {
	}

	void foo() {
	}

	~this() {
	}

}


dmd -H -o- a.d:

// D import file generated from 'a.d'
module lib.a;
class C
{
	this()
	{
	}
	void foo();
	~this();
}

The destructor and member function definitions have been removed 
as expected. What is the reason for keeping the constructor 
definition?
Sep 06 2019