I am trying to get started with templates and variable templates but, when I am just trying to copy what Stroustrup says in its book, Xcode returns me 2 errors ("Expected ')' and 'Incomplete struct'").
Could you please me give an example to how to declare a Variable template with a struct and its constructor, variable declarations, destructors, etc.? In the book it is a bit messy and I'd need something simple to keep in mind!
Your example is apparently a declaration of a class template with a non-template non-static data member with a typo: it should be template<typename T> struct S{T val;};