HaxeFoundation / HaxeFoundation/haxe

[cpp] Extend Map and IMap interface

Open
#7,592 2 comments 0 reactions 0 assignees View on GitHub
feature-coretype platform-cpp
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

This is a bit lengthy, and probably pretty hairy! :grimacing:

I'm trying to extend the standard `Map` (and `IMap`), so that I could add a couple of methods to it. But am encountering some issues with cpp (other targets seem to be OK).

My best effort on trying to reduce the issue so far is here (for now): https://github.com/azrafe7/hxtend_map/blob/c778207b6a11d457be5374b53f5a4cc7c3d99058/Issue.hx

The cpp compiler complains with something like:

```
Error: In file included from ./src/XStringMap.cpp:8:0:
include/XStringMap.h:58:8: error: ‘void XStringMap_obj::set_41d0cb46(Dynamic, Dynamic)’ cannot be overloaded
void set_41d0cb46( ::Dynamic k, ::Dynamic v);
^
include/XStringMap.h:50:8: error: with ‘void XStringMap_obj::set_41d0cb46(Dynamic, Dynamic)’
void set_41d0cb46( ::Dynamic k, ::Dynamic v);
^
./src/XStringMap.cpp:91:6: error: redefinition of ‘void XStringMap_obj::set_41d0cb46(Dynamic, Dynamic)’
void XStringMap_obj::set_41d0cb46( ::Dynamic k, ::Dynamic v) {
^
./src/XStringMap.cpp:75:6: error: ‘void XStringMap_obj::set_41d0cb46(Dynamic, Dynamic)’ previously defined here
void XStringMap_obj::set_41d0cb46( ::Dynamic k, ::Dynamic v) {
^
```

(travis log: https://travis-ci.org/azrafe7/hxtend_map/builds/450644462)

Other targets seem to be OK with it.

**PS:** I've also tried a _bottom-up_ approach (https://gist.github.com/azrafe7/9740c24595247f25bcf497c93835094c) to better identify the issue, but hxcpp is ok with that gist. So I've taken my codebase and tried to remove all unnecessary things.

If you want me to test something on my end I've no problem doing it.

Thanks

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.