aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/utility/Utility.hpp
blob: e8d72051150daf1f7d3db2a0e8455430d5df45d9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#pragma once

namespace OpenVic::utility {
   [[noreturn]] inline void unreachable() {
      // Uses compiler specific extensions if possible.
      // Even if no extension is used, undefined behavior is still raised by
      // an empty function body and the noreturn attribute.
#ifdef __GNUC__ // GCC, Clang, ICC
      __builtin_unreachable();
#elif defined(_MSC_VER) // MSVC
      __assume(false);
#endif
   }
}