mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Add example code for T.48 (#1422)
* Add example code for T.48
* Fix whitespace in end of line
* Use better syntax for concept constraint
* Revert "Use better syntax for concept constraint"
This reverts commit f071920d7f
.
This commit is contained in:
parent
4c35d4c022
commit
2d40c3ac2c
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user