© { JSL }
83
Text Box: struct Constructor
struct Constructor
Folded Corner:
·unusual rules
wcompiler declares default c'tor
wyou cannot declare the default c'tor
wdefault c'tor zero-initialises all instance fields
struct Pair
{
}
compile time error
struct Pair
{
    public Pair(int x, int y) {...}
}
compiler
declares a default c'tor
struct Pair
{
    public Pair() { ... }
}
compiler declared default c'tor still exists