crystalnet icon indicating copy to clipboard operation
crystalnet copied to clipboard

use std exceptions or c++20 contract for runtime errors

Open lgarithm opened this issue 7 years ago • 3 comments

  • http://en.cppreference.com/w/cpp/error/exception

lgarithm avatar Apr 07 '18 14:04 lgarithm

Currently std::invalid_argument should be sufficient for our use case.

lgarithm avatar May 14 '18 05:05 lgarithm

We should limit the usage of exception in the phase of building logical model, which would trigger a fast fail.

To archive this, we might need to introduce two kinds of context, one allows throwing exception, and one doesn't. (This sounds like the IO monad in Haskell).

lgarithm avatar May 23 '18 05:05 lgarithm

should use c++20 contract when it is available

  • https://en.cppreference.com/w/cpp/language/attributes/contract
  • https://libcxx.llvm.org/cxx2a_status.html
  • https://gcc.gnu.org/projects/cxx-status.html

lgarithm avatar Oct 17 '18 18:10 lgarithm