'Passing arguments by template -- for efficiency?
There are two standard methods of passing arguments -- by value, and constant reference. Each has its trade-offs, with value being preferable in most cases that the data is very small. However, I just recently looked into templates more, and the way I understand it, they act more like a macro. Could you use templates to favor efficiency (disregarding bad code cleanliness for now)? For example, if I passed a std::vector through a template, would it allow access to the current scope to the function called?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
