isManifestConstant

Check if a member is manifest constant

  1. bool isManifestConstant()
    bool
    isManifestConstant
    (
    T
    string name
    )
    ()
  2. bool isManifestConstant()

Examples

it should describe a public manifest constant

struct Test {
  enum config = 3;
}

auto result = describeManifestConstant!(Test, "config");

result.name.should.equal("config");
result.value.should.equal("3");

result.type.name.should.equal("int");
result.type.isManifestConstant.should.equal(true);

result.protection.should.equal(Protection.public_);

result.location.file.should.equal("source/introspection/manifestConstant.d");
result.location.line.should.be.greaterThan(0);
result.location.column.should.equal(3);

it should describe a private manifest constant

struct Test {
  private enum config = "test";
}

auto result = describeManifestConstant!(Test, "config");

result.name.should.equal("config");
result.value.should.equal("test");

result.type.name.should.equal("string");
result.type.isManifestConstant.should.equal(true);

result.protection.should.equal(Protection.private_);

Meta