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

Revert emplace_back to the non-C++11 push_back #22

Merged
merged 1 commit into from
Apr 28, 2017

Conversation

henningjp
Copy link
Contributor

For speed increases, the push_back() functions were replaced with emplace_back() in #17. However, one of the goals of the CoolProp project is to maintain MSVC 2008 compatibility. Since emplace_back() is a C++11 language standard and not supported in MSVC 2008, this functionality has been reverted, while the other optimization items in #17 have been retained. Users desiring the emplace speed increases can refer to the previous commit (90cfa1e), however, CoolProp/CoolProp will reference this commit or later.

@henningjp henningjp merged commit 4810799 into CoolProp:master Apr 28, 2017
@henningjp henningjp deleted the compat branch April 28, 2017 17:11
@jowr
Copy link
Member

jowr commented May 1, 2017

Just a stupid question: Why don't you use a combination of resize (instead of reserve) and then access the elements directly by their index instead of using push_back? The direct access is named element assignment in http://coliru.stacked-crooked.com/a/83d23c2d0dcee2ff that was mentioned in #17

@ibell
Copy link
Contributor

ibell commented May 1, 2017 via email

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.

3 participants