Created
June 19, 2019 11:12
-
-
Save david50407/5801bccfc96c1f7a40b586000479c341 to your computer and use it in GitHub Desktop.
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
#include <vector> | |
template<typename itor> | |
void func(itor x) { | |
typedef typename std::iterator_traits<itor>::value_type T; | |
T value = *x; | |
} | |
int main(void) { | |
std::vector<int> vec; | |
vec.push_back(1); | |
func(vec.begin()); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment