Does C# support templates?

Started by chinmay.sahoo, 03-08-2016, 05:22:05

Previous topic - Next topic

chinmay.sahooTopic starter

No, C# doesn't support templates. They support a type of template known as generic. It has a similar syntax but instantiated during run time.


TomClarke

That is true. C#  support the concept of an indexer  from language spec. Whereas propoerties enable field-like access, indexers enable array-like access.
Indexer declarations are similar to property declarations, with the main differences being that indexers are nameless and that indexers include indexing parameters. The indexing parameters are provided betweeen square brackets.


siyajoshi

#2
No C# do not support template, but no need to worry, you can use generic instead of template in C# both have many differences, but generic provide more functionality and more easy in writing syntax. C# generic work at runtime to instantiated objects and substitutions also performed at runtime.