Skip to content

Commit 5761e1f

Browse files
authored
Split math_exception_impl constructor in two (#84528)
1 parent efe092f commit 5761e1f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/math_parser_type.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,18 @@ class math_exception_impl : public exception
3131
public:
3232
static constexpr int severity = severity_;
3333

34-
template < typename... Args,
34+
constexpr explicit math_exception_impl()
35+
: exception( string_format( "%s", _severity_str<severity_>() ) ) {}
36+
37+
template < typename Arg, typename... Args,
3538
typename = std::enable_if_t <
36-
( sizeof...( Args ) > 0 ) &&
37-
!( ( std::is_same_v<std::decay_t<Args>, math_exception_impl> || ... ) )
39+
!std::is_same_v<std::decay_t<Arg>, math_exception_impl>
40+
>
3841
>
39-
>
40-
constexpr explicit math_exception_impl( Args && ...args )
42+
constexpr explicit math_exception_impl( Arg && arg, Args && ... args )
4143
: exception( string_format( "%s: %s", _severity_str<severity_>(),
42-
string_format( std::forward<Args>( args )... ) ) ) {}
44+
string_format( std::forward<Arg>( arg ),
45+
std::forward<Args>( args )... ) ) ) {}
4346
};
4447

4548
// syntax error in parsed expression

0 commit comments

Comments
 (0)