# Enumerating maps of pointers doesn't work right?

**URL:** <https://community.haxe.org/t/enumerating-maps-of-pointers-doesnt-work-right/4769>\
**Category:** Haxe\
**Tags:** haxe-cpp\
**Created:** [February 12, 2026, 8:35pm UTC](https://community.haxe.org/t/enumerating-maps-of-pointers-doesnt-work-right/4769 "2026-02-12T20:35:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidgiven](https://community.haxe.org/user_avatar/community.haxe.org/davidgiven/32/1326_2.png) [@davidgiven](https://community.haxe.org/u/davidgiven)\
**Post date:** [February 12, 2026, 8:35pm UTC](https://community.haxe.org/t/enumerating-maps-of-pointers-doesnt-work-right/4769/1 "2026-02-12T20:35:10Z")

</div>

Example code:

```haxe
		var value = 99;
		var valuep: Pointer<Int> = untyped __cpp__ ("&{0}", value);

		var map: Map<Pointer<Int>, String> = new Map();
		map[valuep] = "thing";
		trace(map);
		for (lhs => rhs in map)
			trace(lhs, rhs);

```

Result:

```haxe
src/test.hx:105: [Pointer(0x7fff47307e04) => thing]
src/test.hx:107: Pointer(0x7fff47307e04),null

```

It looks as if doing looks on a map of pointers simply doesn’t work, as this produces the same result:

```haxe
	for (lhs in map.keys())
		trace(lhs, map[lhs]);

```

Is this a known bug, and are there any workarounds?
