So, what I'm trying to accomplish is a little unusual, and may need some 
explanation.

Basically, I'm trying to find a typesafe way to access a type-indexed map of 
components.  This map can contain objects of any type, and the keys are 
reflect.Type.

One strategy I thought may work would be to pass a pointer to a pointer as an 
out-var.  Using reflection to determine the pointer's type, it could be 
populated with a corresponding value.

For instance, if we did something like this:

c := ComponentCollection{}
c.addComponent(123) // Add an int component 

var p : *int
c.getComponent(&p)


In this case, p would point to the int component of c.

That's wht the 2 levels of indirection are necessary: it's an out-var to a 
pointer.

Does that make sense?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to