From 418782f142c52d9f4c6eba4804daba78409412d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20Gr=C3=A4ser?= Date: Fri, 15 Nov 2024 11:43:13 +0100 Subject: [PATCH] [advalue] Add static assertion for non-implemented derivative order --- ADOL-C/include/adolc/advalue.h | 1 + 1 file changed, 1 insertion(+) diff --git a/ADOL-C/include/adolc/advalue.h b/ADOL-C/include/adolc/advalue.h index 7648a954..3b128729 100644 --- a/ADOL-C/include/adolc/advalue.h +++ b/ADOL-C/include/adolc/advalue.h @@ -1010,6 +1010,7 @@ auto sqrt(const X& x) return 1./(2.*sqrt(x)); if constexpr (order==2) return -1./(4.*x*sqrt(x)); + static_assert(order <= 2, "Only derivatives up to order 2 are implemented"); }); }