How can I make a function that accepts, for example, a size_t but does NOT accept an int or any other implicitly convertible type?
Use overload:
template <typename T> void foo(T) = delete;
void foo(std::size_t t) {
// ...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With