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 has_static_new #1013

Merged
merged 7 commits into from
May 20, 2017
Merged

Fix has_static_new #1013

merged 7 commits into from
May 20, 2017

Conversation

yeswalrus
Copy link
Contributor

MSVC2015, alone among MSVC versions and for reasons that are beyond me chokes on the function name detection portion of the old has_static_new's SFINAE.
This overhauls it to be far more concise, and compile correctly.

.gitignore Outdated
@@ -45,3 +45,5 @@ autowiring.kdev4
autowiring.VC.db
.vscode
AutowiringVersion.h

*.VC.db*
Copy link
Contributor

Choose a reason for hiding this comment

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

`Autowiring.VC.db is already listed above though?

Or if the intent here is the trailing asterisk, are there circumstances when it makes a db1, db2 file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, 2017 adds several extensions.

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. I have Browse.VC.db and Solution.VC.db{,-shm,-wal}.

Should remove the now-redundant autowiring.VC.db above then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep


TEST_F(AutoConstructTest, MultiStaticNewTest) {
AutoConstruct<MultiStaticNew> badstatic{ 1 };
}
Copy link
Contributor

Choose a reason for hiding this comment

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

missing newline at EOF

Copy link
Contributor

Choose a reason for hiding this comment

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

This var is named badstatic. However, it looks like the good one?

/// </summary>
/// <remarks>
/// A factory New routine is malformed when the return type is not implicitly castable to type T
/// </remarks>
Copy link
Contributor

Choose a reason for hiding this comment

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

Should keep the comments? I found the <remarks> line useful initially.

@jdonald
Copy link
Contributor

jdonald commented May 18, 2017

This implementation is effectively -38 +10. I've tested platform on OS X and MSVC2013 and it probably works everywhere. Great work, @yeswalrus !

Copy link
Contributor

@gittyupagain gittyupagain left a comment

Choose a reason for hiding this comment

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

I'm in agreement with @jdonald. Well done, @yeswalrus. If you can resolve @jdonald's remaining minor issues, this should be good to go.

[**]
indent_style = space
indent_size = 2
insert_final_newline = true
Copy link
Contributor

Choose a reason for hiding this comment

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

Ironic that this file is missing its final newline!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sadly, VS2017 has default support for editor config but ignores the 2 most useful options: insert_final_newline and trim_trailing_whitespace

@jdonald jdonald merged commit ee50d77 into master May 20, 2017
@jdonald jdonald deleted the fix-vs2015 branch May 20, 2017 01:38
@yeswalrus yeswalrus added this to the v1.0.4 milestone May 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants