xtd 1.0.0
Loading...
Searching...
No Matches
__xtd_unreachable.hpp
Go to the documentation of this file.
1
3#pragma once
5#if !defined(__XTD_CORE_INTERNAL__)
6#error "Do not include this file: Internal use only"
7#endif
9
11#if !defined(NDEBUG) && defined(_MSC_VER)
12# define __xtd_unreachable() (__assume(false))
13#elif !defined(NDEBUG) && (defined(__GNUC__) || defined(__clang__))
14# define __xtd_unreachable() (__builtin_unreachable())
15#else
16#include <cstdlib>
17[[noreturn]] inline auto ___unreachable___() noexcept -> void {std::_Exit(0);}
18#define __xtd_unreachable() (___unreachable___())
19#endif