Skip to content

Commit 0363510

Browse files
committed
we do need the overload due to C API
Signed-off-by: Martijn Govers <[email protected]>
1 parent 29e3689 commit 0363510

File tree

1 file changed

+5
-1
lines changed
  • power_grid_model_c/power_grid_model/include/power_grid_model/common

1 file changed

+5
-1
lines changed

power_grid_model_c/power_grid_model/include/power_grid_model/common/exception.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,14 @@ class InvalidArguments : public PowerGridError {
5252

5353
class MissingCaseForEnumError : public InvalidArguments {
5454
public:
55+
template <typename T>
56+
MissingCaseForEnumError(std::string_view method, T const& value)
57+
: InvalidArguments{method, std::format("{} #{:d}", typeid(T).name(), value)} {}
58+
5559
template <typename T>
5660
requires std::is_enum_v<T>
5761
MissingCaseForEnumError(std::string_view method, T const& value)
58-
: InvalidArguments{method, std::format("{} #{:d}", typeid(T).name(), std::to_underlying(value))} {}
62+
: MissingCaseForEnumError{method, std::to_underlying(value)} {}
5963
};
6064

6165
class ConflictVoltage : public PowerGridError {

0 commit comments

Comments
 (0)