diff --git a/docs/understanding-generics.md b/docs/understanding-generics.md index fe4dcc1..cc254e0 100644 --- a/docs/understanding-generics.md +++ b/docs/understanding-generics.md @@ -298,14 +298,14 @@ Benefits of Slang's approach: what methods are valid for generic types, unlike C++ template parameters. There are certain things which work with C++ style templates, which are -(deliberatly) disallowed with Slang generics. For example the following code +(deliberately) disallowed with Slang generics. For example the following code will work in C++ but the naïve equivalent in Slang will not compile. ```cpp // This function will compile when instantiated at a type which supports the + // operator. However this restriction is only discovered at the call site. -template -float addValue(T v0, T v1) { return v0.x + v1.x; } +template +float addValue(T v0, T v1) { return v0 + v1; } // We happen to call `addValue` with a type that supports addition. void user() {addValue(1,2); }