denniskb / spice2

The Spice SNN Simulator
Other
6 stars 0 forks source link

Check user-provided types/parameters for conformity with human-readable error messages #15

Closed denniskb closed 2 years ago

denniskb commented 2 years ago

Write public API functions in terms of unrestricted templates. Use static_assert() to perform validity checks on them and give useful feedback to the user. Forward the call to private member functions that expect concepts instead of unrestricted templates.

This way we provide useful error messages to the user but still make our concepts the ultimate arbitror of truth in case our static asserts contain gaps.