1 #ifndef SAUCE_INTERNAL_SELF_INJECTOR_H_
2 #define SAUCE_INTERNAL_SELF_INJECTOR_H_
4 #include <sauce/memory.h>
17 typedef sauce::shared_ptr<T> Ptr;
19 template<
typename DoesNotRequest>
20 void setSelfIfRequested(Ptr, ...) {}
22 template<
typename Requests>
23 void setSelfIfRequested(Ptr ptr,
typename Requests::RequestsSelfInjection *) {
24 sauce::weak_ptr<typename Requests::RequestsSelfInjection> weak(ptr);
30 void setSelf(Ptr ptr) {
31 setSelfIfRequested<T>(ptr, 0);
37 namespace i = ::sauce::internal;
41 #endif // SAUCE_INTERNAL_SELF_INJECTOR_H_
If a type requests injection of its own smart pointer, do so.
Definition: self_injector.h:16