c++ - How to have: map<T, vector<iterator to map itself> >? -


i need map keys of composite type t vector of iterators of map itself.
(e.g., think of graph in every node holds iterators point parents.)

the reason i'm avoiding storing parents' keys values keys expensive objects, i'd store iterators instead.

is such thing possible?
if not, what's best alternative?

(i know can use polymorphism , type erasure brute-force way solve this, i'm wondering if there's better way.)

due 23.2.1 general container requirements:

containers objects store other objects. control allocation , deallocation of these objects through constructors, destructors,  insert , erase operations. 

hence possible:

struct key; struct value; typedef std::map<key, value> map;  struct key {}; struct value {     std::vector<map::iterator> parents; }; 

(all types , sizes known)


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -