Skip to content

Commit 51d0f3c

Browse files
amadiobernhardmgruber
authored andcommitted
Use C++11 for std::is_floating_point in static_assert slide
This is to be able to mark the slide as C++11 for the static_assert instead of C++17 because of the usage of std::is_floating_point_v.
1 parent d46b0e6 commit 51d0f3c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

talk/basicconcepts/assert.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
\begin{cppcode*}{}
7878
double f(UserType a) {
7979
static_assert(
80-
std::is_floating_point_v<UserType>,
80+
std::is_floating_point<UserType>::value,
8181
"This function expects floating-point types.");
8282
return std::sqrt(a);
8383
}
@@ -89,7 +89,7 @@
8989
\textcolor{blue}{a.cpp:3:9:} \textcolor{red}{error:} \textcolor{blue}{static assertion failed: This function}
9090
\textcolor{blue}{expects floating-point types.}
9191
2 | static_assert(
92-
| \textcolor{red}{std::is_floating_point_v<UserType>},
93-
| \textcolor{red}{~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
92+
| \textcolor{red}{std::is_floating_point<UserType>::value},
93+
| \textcolor{red}{~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
9494
\end{Verbatim}
9595
\end{frame}

0 commit comments

Comments
 (0)