We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d1d0c6 commit ed87afaCopy full SHA for ed87afa
docs/understanding-generics.md
@@ -304,8 +304,8 @@ will work in C++ but the naïve equivalent in Slang will not compile.
304
```cpp
305
// This function will compile when instantiated at a type which supports the +
306
// operator. However this restriction is only discovered at the call site.
307
-template<T>
308
-float addValue(T v0, T v1) { return v0.x + v1.x; }
+template<typename T>
+float addValue(T v0, T v1) { return v0 + v1; }
309
310
// We happen to call `addValue` with a type that supports addition.
311
void user() {addValue(1,2); }
0 commit comments