1
0
Fork 0
mirror of https://github.com/Neargye/magic_enum.git synced 2026-01-10 23:44:29 +00:00

make streams and exceptions optional (#218)

* magic_enum: make streams optional
this commit adds support to disable streams
with macro MAGIC_ENUM_NO_STREAMS

* magic_enum_format: add support to disable exceptions
this commit adds support to disable exceptions
with macro MAGIC_ENUM_NO_EXCEPTIONS
This commit is contained in:
ilobilo 2022-11-04 23:46:37 +04:00 committed by GitHub
parent 159a35006d
commit 596f00c0db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 3 deletions

View file

@ -40,7 +40,6 @@
#include <cassert>
#include <cstdint>
#include <cstddef>
#include <iosfwd>
#include <limits>
#include <type_traits>
#include <utility>
@ -59,6 +58,9 @@
#if !defined(MAGIC_ENUM_USING_ALIAS_STRING_VIEW)
#include <string_view>
#endif
#if !defined(MAGIC_ENUM_NO_STREAMS)
#include <iosfwd>
#endif
#if defined(__clang__)
# pragma clang diagnostic push
@ -1381,6 +1383,8 @@ constexpr auto enum_for_each(Lambda&& lambda) {
}
}
#if !defined(MAGIC_ENUM_NO_STREAMS)
namespace ostream_operators {
template <typename Char, typename Traits, typename E, detail::enable_if_t<E, int> = 0>
@ -1431,6 +1435,8 @@ using namespace istream_operators;
} // namespace magic_enum::iostream_operators
#endif
namespace bitwise_operators {
template <typename E, detail::enable_if_t<E, int> = 0>