Using the type checks with `static_assert` on function or class template types will provide users with helpful error messages and prevent undefined behaviors. This example shows how a template function which writes to a synchronous stream may check its argument:
Using the type checks with `static_assert` on function or class template types will provide users with helpful error messages and prevent undefined behaviors. This example shows how a template function which writes to a synchronous stream may check its argument: