static class A { int bar; } static class B { A foo = new A(); } static class C { B bar = new B(); } static assert(hasNestedMember!(B, "foo.bar")); static assert(!hasNestedMember!(B, "data.bar")); static assert(!hasNestedMember!(B, "foo.baz")); static assert(hasNestedMember!(B, "foo")); static assert(!hasNestedMember!(B, "fooz")); static assert(!hasNestedMember!(C, "bar.foo.baz")); static assert(hasNestedMember!(C, "bar.foo.bar"));
Test existance of the nested member (or not nested).