Skip to content

It does not compile if I need to compile my project with -fno-exceptions flag #20

@rokoDev

Description

@rokoDev

To fix this I think we can define macro:

#if defined(__cpp_exceptions) || defined(_CPPUNWIND)
#define ZEUS_EXPECTED_EXCEPTIONS_ENABLED
#endif

#ifdef ZEUS_EXPECTED_EXCEPTIONS_ENABLED
#define ZEUS_EXPECTED_THROW_EXCEPTION(e) throw((e));
#else
#define ZEUS_EXPECTED_THROW_EXCEPTION(e) std::terminate();
#endif

and instead of throwing exception directly throw bad_expected_access(error()); we should call this macro like this: ZEUS_EXPECTED_THROW_EXCEPTION(bad_expected_access(error()));

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