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 for unsafe_any_cast #198

Merged
merged 2 commits into from Mar 31, 2017

Conversation

Projects
None yet
4 participants
@karthikreddy09
Contributor

karthikreddy09 commented Mar 29, 2017

Signed-off-by: Mathworks Inc Roy.Lurie@mathworks.com

Fix for unsafe_any_cast
Signed-off-by: Mathworks Inc <Roy.Lurie@mathworks.com>
@@ -29,6 +29,14 @@
using namespace cppmicroservices;
template <typename T>
void TestUnsafeAnyCast(Any& anyObj, T val)
{

This comment has been minimized.

@ksubramz

ksubramz Mar 29, 2017

Contributor

Maybe assign the unsafe cast to a local ptr?

T* ptr = unsafe_any_cast<T>(&anyObj);
US_TEST_CONDITION(ptr, "unsafe_any_cast");

and similarly for other 2 US_TEST_CONDITIONs

@ksubramz

ksubramz Mar 29, 2017

Contributor

Maybe assign the unsafe cast to a local ptr?

T* ptr = unsafe_any_cast<T>(&anyObj);
US_TEST_CONDITION(ptr, "unsafe_any_cast");

and similarly for other 2 US_TEST_CONDITIONs

Minor change to optimize TestUnsafeAnyCast method
Signed-off-by: Mathworks Inc <Roy.Lurie@mathworks.com>

@karthikreddy09 karthikreddy09 self-assigned this Mar 31, 2017

@karthikreddy09 karthikreddy09 merged commit ae83b81 into development Mar 31, 2017

4 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@karthikreddy09 karthikreddy09 deleted the 197-fix-unsafe-any-cast branch Mar 31, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment