isManifestConstant

Check if a member is manifest constant

  1. bool isManifestConstant()
  2. bool isManifestConstant()
    bool
    isManifestConstant
    ()
    ()

Examples

it should describe a public manifest constant

1 struct Test {
2   enum config = 3;
3 }
4 
5 auto result = describeManifestConstant!(Test, "config");
6 
7 result.name.should.equal("config");
8 result.value.should.equal("3");
9 
10 result.type.name.should.equal("int");
11 result.type.isManifestConstant.should.equal(true);
12 
13 result.protection.should.equal(Protection.public_);
14 
15 result.location.file.should.equal("source/introspection/manifestConstant.d");
16 result.location.line.should.be.greaterThan(0);
17 result.location.column.should.equal(3);

it should describe a private manifest constant

1 struct Test {
2   private enum config = "test";
3 }
4 
5 auto result = describeManifestConstant!(Test, "config");
6 
7 result.name.should.equal("config");
8 result.value.should.equal("test");
9 
10 result.type.name.should.equal("string");
11 result.type.isManifestConstant.should.equal(true);
12 
13 result.protection.should.equal(Protection.private_);

Meta