mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 04:44:34 +03:00
Add example code for T.48
This commit is contained in:
@@ -17528,7 +17528,19 @@ Because that's the best we can do without direct concept support.
|
||||
|
||||
##### Example
|
||||
|
||||
enable_if<???>
|
||||
template <typename T>
|
||||
enable_if_t<is_integral_v<T>>
|
||||
f(T v)
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
// Equivalent to:
|
||||
template <Integral T>
|
||||
void f(T v)
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
##### Note
|
||||
|
||||
|
||||
Reference in New Issue
Block a user