Skip to content

Add boost::unreachable #180

@denzor200

Description

@denzor200

C++11 users need an analogue of std::unreachable. Might be easily implemented in the way cppreference suggests:

[[noreturn]] inline void unreachable()
{
#if defined(_MSC_VER) && !defined(__clang__) // MSVC
    __assume(false);
#else // GCC, Clang
    __builtin_unreachable();
#endif
}

https://en.cppreference.com/w/cpp/utility/unreachable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions