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

Compiler Error C2398 on BoxPacker2D.cpp #4

Closed
gustav21 opened this issue Aug 9, 2016 · 3 comments
Closed

Compiler Error C2398 on BoxPacker2D.cpp #4

gustav21 opened this issue Aug 9, 2016 · 3 comments
Labels

Comments

@gustav21
Copy link
Contributor

gustav21 commented Aug 9, 2016

In Visual Studio 2015 I had a compiler error C2398: conversion from 'std::chrono::system_clock::rep' to 'unsigned int' requires a narrowing conversion.

This error arises in BoxPacker2D::packThem method here:

        // randomize
        std::default_random_engine engine
        {
            std::chrono::system_clock::now().time_since_epoch().count() };

Changing the case of initialization from braces to parentheses has solved the problem for me:

        // randomize
        std::default_random_engine engine
        (
            std::chrono::system_clock::now().time_since_epoch().count() );

About initializers and kinds of initialization one can read here.

@JamesBremner
Copy link
Owner

The change you propose seems harmless. Please fork the repository, make and test the change, and submit a pull request. I can then accept the pull request.

@JamesBremner
Copy link
Owner

Pull request #6 accepted and merged.

Can we close this now?

@gustav21
Copy link
Contributor Author

Sorry, sure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants