Why are constructor definitions preserved in interface files?

Max Samukha maxsamukha at gmail.com
Fri Sep 6 08:07:16 UTC 2019


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?



More information about the Digitalmars-d-learn mailing list