Skip to content

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

Closed

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()));

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions