I don’t think this would be possible. On some STL libraries you actually have a vector iterator as a pointer type, i.e. std::vector<T>::iterator is a T*
so I can’t think of any way you could get back to the container type from that.
More Related Contents:
- Does C++ support compile-time counters?
- Why C++ containers don’t allow incomplete types?
- SFINAE to check for inherited member functions
- Can standard container templates be instantiated with incomplete types?
- Determine if a type is an STL container at compile time
- C++ SFINAE examples?
- Can you make custom operators in C++?
- Template class with template container
- Best introduction to C++ template metaprogramming? [closed]
- C++: How to require that one template type is derived from the other
- How to know if a type is a specialization of std::vector?
- How can I expand call to variadic template base classes?
- Standard Library Containers with additional optional template parameters?
- C++ std::map holding ANY type of value
- Why is the STL so heavily based on templates instead of inheritance?
- Template Metaprogramming – Difference Between Using Enum Hack and Static Const
- C++11 is_same type trait for templates
- C++ Template Metaprogramming – Is it possible to output the generated code?
- C++ template function compiles in header but not implementation
- calculating factorial using template meta-programming
- Why does stack not compile in g++? [duplicate]
- Template metaprogram converting type to unique number
- Why is partial specialization of a nested class template allowed, while complete isn’t?
- How do I sort a vector of pairs based on the second element of the pair?
- How are iterators and pointers related?
- Is there a production ready lock-free queue or hash implementation in C++ [closed]
- Select class constructor using enable_if
- How is C++ std::vector implemented?
- Compile time sizeof_array without using a macro
- Incomplete class usage in template