Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
4003CEM-templates_orig/lab_template_return.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
21 lines (16 sloc)
712 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Complete the template definition of the add_together() | |
function. | |
add_together() should take two iterators as its input parameters. | |
These iterators represent the beginning and end of the sequence to be | |
added together. | |
A useful hint, if you want to know the variable type that an iterator | |
contains you can use the following code: | |
typename iterator_traits<ITER>::value_type | |
Where ITER is either a template placeholder or an actual iterator. | |
This line can be used to specify variable or function return types. | |
For example: | |
std::vector<int> v {1, 2, 3}; | |
std::vector<int>::iterator it = v.begin(); | |
typename std::iterator_traits<it>::value_type intValue = *it; | |
*/ | |
// COMPLETE ME |