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

Fix static assert in CreationRules #741

Merged
merged 1 commit into from
Sep 17, 2015
Merged

Fix static assert in CreationRules #741

merged 1 commit into from
Sep 17, 2015

Conversation

codemercenary
Copy link
Contributor

Factory New methods presently are not being correctly evaluated for the inheritance rules that are required for factory New when the method has one or more arguments. Alter the static assert to be applied in all cases where static new is used.

Factory `New` methods presently are not being correctly evaluated for the inheritance rules that are required for factory `New` when the method has one or more arguments.  Alter the static assert to be applied in all cases where static new is used.
@@ -85,7 +85,7 @@ struct crh<construction_strategy::factory_new, T, Args...>
typedef T TActual;

static_assert(
std::is_base_of<CoreObject, T>::value || !has_static_new<T>::value,
std::is_base_of<CoreObject, T>::value,
"If type T provides a static New method, then the constructed type MUST directly inherit Object"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This string "If type T provides a static New method..." matched the old static_assert, but if you make the above change, doesn't it become merely "The constructed type MUST directly inherit Object" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because this whole template type--crh--is only instantiated in cases where T is being constructed via a factory new call.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see now.

jdonald added a commit that referenced this pull request Sep 17, 2015
@jdonald jdonald merged commit 14ccb34 into develop Sep 17, 2015
@jdonald jdonald deleted the ref-factorynewassert branch September 17, 2015 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants