Skip to content

Commit de0872c

Browse files
committed
[advalue] Add static assertion for non-implemented derivative order
1 parent 263ff71 commit de0872c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ADOL-C/include/adolc/advalue.h

+1
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,7 @@ auto sqrt(const X& x)
10101010
return 1./(2.*sqrt(x));
10111011
if constexpr (order==2)
10121012
return -1./(4.*x*sqrt(x));
1013+
static_assert(order <= 2, "Only derivatives up to order 2 are implemented");
10131014
});
10141015
}
10151016

0 commit comments

Comments
 (0)