mirror of
https://github.com/mbierlee/poodinis.git
synced 2024-11-15 04:04:01 +01:00
Use type instead of instance for compatibitlity with old compilers
This commit is contained in:
parent
33b9410354
commit
78f89ccc1f
|
@ -309,7 +309,7 @@ class AutowiredRegistration(RegistrationType : Object) : Registration {
|
||||||
private void delegate() getPreDestructor(RegistrationType instance) {
|
private void delegate() getPreDestructor(RegistrationType instance) {
|
||||||
void delegate() preDestructor = null;
|
void delegate() preDestructor = null;
|
||||||
static foreach (memberName; __traits(allMembers, RegistrationType)) {
|
static foreach (memberName; __traits(allMembers, RegistrationType)) {
|
||||||
static foreach (overload; __traits(getOverloads, instance, memberName)) {
|
static foreach (overload; __traits(getOverloads, RegistrationType, memberName)) {
|
||||||
static if (__traits(compiles, __traits(getProtection, overload))
|
static if (__traits(compiles, __traits(getProtection, overload))
|
||||||
&& __traits(getProtection, overload) == "public"
|
&& __traits(getProtection, overload) == "public"
|
||||||
&& isFunction!overload
|
&& isFunction!overload
|
||||||
|
|
|
@ -421,7 +421,7 @@ synchronized class DependencyContainer {
|
||||||
|
|
||||||
private void callPostConstructors(Type)(Type instance) {
|
private void callPostConstructors(Type)(Type instance) {
|
||||||
static foreach (memberName; __traits(allMembers, Type)) {
|
static foreach (memberName; __traits(allMembers, Type)) {
|
||||||
static foreach (overload; __traits(getOverloads, instance, memberName)) {
|
static foreach (overload; __traits(getOverloads, Type, memberName)) {
|
||||||
static if (__traits(compiles, __traits(getProtection, overload))
|
static if (__traits(compiles, __traits(getProtection, overload))
|
||||||
&& __traits(getProtection, overload) == "public"
|
&& __traits(getProtection, overload) == "public"
|
||||||
&& isFunction!overload
|
&& isFunction!overload
|
||||||
|
|
|
@ -65,7 +65,7 @@ public void registerContext(Context : ApplicationContext)(shared(DependencyConta
|
||||||
public void registerContextComponents(ApplicationContextType : ApplicationContext)(
|
public void registerContextComponents(ApplicationContextType : ApplicationContext)(
|
||||||
ApplicationContextType context, shared(DependencyContainer) container) {
|
ApplicationContextType context, shared(DependencyContainer) container) {
|
||||||
foreach (memberName; __traits(allMembers, ApplicationContextType)) {
|
foreach (memberName; __traits(allMembers, ApplicationContextType)) {
|
||||||
foreach (overload; __traits(getOverloads, context, memberName)) {
|
foreach (overload; __traits(getOverloads, ApplicationContextType, memberName)) {
|
||||||
static if (__traits(getProtection, overload) == "public" && hasUDA!(overload, Component)) {
|
static if (__traits(getProtection, overload) == "public" && hasUDA!(overload, Component)) {
|
||||||
auto factoryMethod = &__traits(getMember, context, memberName);
|
auto factoryMethod = &__traits(getMember, context, memberName);
|
||||||
Registration registration = null;
|
Registration registration = null;
|
||||||
|
|
Loading…
Reference in a new issue