Skip to content

Commit

Permalink
Add static_assert_false.cpp (pybind/pybind11#5460 (comment)).
Browse files Browse the repository at this point in the history
  • Loading branch information
rwgk committed Dec 21, 2024
1 parent 89c2bb0 commit fc26834
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions kb/static_assert_false.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
template <typename T>
void foo() {
static_assert(false, "foo<>() is not meant to be instantiated.");
}

int main() {
#ifdef USE_FOO
foo<int>();
#endif
return 0;
}

0 comments on commit fc26834

Please sign in to comment.