Giter VIP home page Giter VIP logo

Comments (4)

foonathan avatar foonathan commented on June 16, 2024

That's really odd. Could you maybe debug and give me a callstack?

from type_safe.

NathanMorley avatar NathanMorley commented on June 16, 2024

Visual Studio 2017 catches the error before running the project, so I suppose it is a compile-time error. The call hierarchy shows that there are no calls to "on_disable_exception", though there is a long chain of calls from it, seemingly recursive.

Actually I just dug around through "debug_assert.hpp" for a while and noticed "struct source_location" has an unsigned member "line_number". Underneath, a macro is defined which inserts the __LINE__ macro into line_number:

//=== source location ===//
    /// Defines a location in the source code.
    struct source_location
    {
        const char* file_name;   ///< The file name.
        unsigned    line_number; ///< The line number.
    };

/// Expands to the current [debug_assert::source_location]().
#define DEBUG_ASSERT_CUR_SOURCE_LOCATION                                                           \
    debug_assert::source_location                                                                  \
    {                                                                                              \
        __FILE__, __LINE__                                                                         \
    }

Replacing __LINE__ with static_cast<unsigned>(__LINE__) resolves the error and allows me to build and run the project. I am not sure why __LINE__ is of long type, but herein lies the solution.

from type_safe.

foonathan avatar foonathan commented on June 16, 2024

Oh, sorry, I completely misread your error message.

Could you maybe provide a PR for debug_assert?

from type_safe.

NathanMorley avatar NathanMorley commented on June 16, 2024

I do not know what a "PR" is, however I did find and provide a solution for the problem at the end of my last comment. Nevermind, you meant "pull-request." I can do that.

from type_safe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.