Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing a pointer cast registry mechanism #298

Merged
merged 1 commit into from
Dec 30, 2014
Merged

Conversation

codemercenary
Copy link
Contributor

This mechanism allows users to autowire types that are completely undefined. Generally speaking, any function whose behavior might depend on whether the Autowired instance has been autowired or not will require that the type be completely defined. This includes obvious functions, such as Autowired::operator->, but also less obvious functions such as Autowired::NotifyWhenAutowired and Autowired::operator bool.

As a trapdoor, the function Autowired::get_unsafe has been added. This function does not require that the autowired type be registered, but inconsistent behavior will result if it's not, especially when dealing with class interfaces.

This mechanism allows users to autowire types that are completely undefined.  Generally speaking, any function whose behavior might depend on whether the Autowired instance has been autowired or not will require that the type be completely defined.  This includes obvious functions, such as `Autowired::operator->`, but also less obvious functions such as `Autowired::NotifyWhenAutowired` and `Autowired::operator bool`.

As a trapdoor, the function `Autowired::get_unsafe` has been added.  This function does not require that the autowired type be registered, but inconsistent behavior will result if it's not, especially when dealing with class interfaces.
tnitz added a commit that referenced this pull request Dec 30, 2014
Implementing a pointer cast registry mechanism
@tnitz tnitz merged commit 71bb766 into develop Dec 30, 2014
@tnitz tnitz deleted the feature-castregistry branch December 30, 2014 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants