Accessing the value_type of a specific vector.

Jan 31, 2017 at 2:06pm
Does anyone know if there is a way to make something like...

1
2
vector<int> v{};
using vtype = v.value_type;


work? Thanks in advance!
Last edited on Jan 31, 2017 at 2:07pm
Jan 31, 2017 at 2:22pm
1
2
3
4
std::vector<int> v{};

using vtype = std::vector<int>::value_type;
using vtype = decltype(v)::value_type;
Jan 31, 2017 at 3:45pm
I appreciate it sir. I'm unfamiliar wit the uses of decltype.
Topic archived. No new replies allowed.