{"action":"created","issue":{"url":"https://api.github.com/repos/dlang/druntime/issues/1316","repository_url":"https://api.github.com/repos/dlang/druntime","labels_url":"https://api.github.com/repos/dlang/druntime/issues/1316/labels{/name}","comments_url":"https://api.github.com/repos/dlang/druntime/issues/1316/comments","events_url":"https://api.github.com/repos/dlang/druntime/issues/1316/events","html_url":"https://github.com/dlang/druntime/pull/1316","id":93148187,"number":1316,"title":"Addition of C++ std::string, std::vector to D","user":{"login":"gchatelet","id":149665,"avatar_url":"https://avatars.githubusercontent.com/u/149665?v=3","gravatar_id":"","url":"https://api.github.com/users/gchatelet","html_url":"https://github.com/gchatelet","followers_url":"https://api.github.com/users/gchatelet/followers","following_url":"https://api.github.com/users/gchatelet/following{/other_user}","gists_url":"https://api.github.com/users/gchatelet/gists{/gist_id}","starred_url":"https://api.github.com/users/gchatelet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gchatelet/subscriptions","organizations_url":"https://api.github.com/users/gchatelet/orgs","repos_url":"https://api.github.com/users/gchatelet/repos","events_url":"https://api.github.com/users/gchatelet/events{/privacy}","received_events_url":"https://api.github.com/users/gchatelet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2015-07-05T21:23:39Z","updated_at":"2017-02-22T11:18:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dlang/druntime/pulls/1316","html_url":"https://github.com/dlang/druntime/pull/1316","diff_url":"https://github.com/dlang/druntime/pull/1316.diff","patch_url":"https://github.com/dlang/druntime/pull/1316.patch"},"body":"This is an early version serving as a basis for discussion since :\n- there is no tests yet.\n- it works only for std::string on Linux because of broken name mangling (no std::wstring, no std::vector).\n- reverse iterator are not implemented.\n- some functions are missing.\n\nAlso a few points to note :\n## mangling\n- D ctor/dtor are not mangled as in C++, this need to be fixed.\n- std::string defines operators to make working with string easier : =, ==, +=, operator bool. D cannot mangle them correctly for now.\n- To prevent WTFs, STL containers are represented in D with value semantic (implemented as structs) but some platforms (eg. Windows) mangle struct and class differently. Since std::string is declared as a class in C++, D would not produce the expected mangling. One would need to add a #pragma(mangleAs, class).\n## string\n- The current proposal replicates the C++ API for completeness. A simpler design could present `std_string` as a opaque type with a different, simpler API, basically getters/setters from D `string`.\n- D struct ctor/dtor semantic conflicts with C++ semantic. Struct default ctor must be @disable so there's no way to construct an empty string apart from calling std::string(const char*) with empty string.\n## vector\n- Basically just a skeleton for now (guarded by `version(none)`), it is not functional because of mangling issues.\n## dependency on libstdc++\n- Addition of strings would require a dependency on libstdc++, we probably want to guard it behind a flag _a la_ `CRuntime_Glibc`.\n- Pragma(lib) looks inappropriate to specify libstdc++, Makefile ?\n"},"comment":{"url":"https://api.github.com/repos/dlang/druntime/issues/comments/281641449","html_url":"https://github.com/dlang/druntime/pull/1316#issuecomment-281641449","issue_url":"https://api.github.com/repos/dlang/druntime/issues/1316","id":281641449,"user":{"login":"timotheecour","id":2194784,"avatar_url":"https://avatars.githubusercontent.com/u/2194784?v=3","gravatar_id":"","url":"https://api.github.com/users/timotheecour","html_url":"https://github.com/timotheecour","followers_url":"https://api.github.com/users/timotheecour/followers","following_url":"https://api.github.com/users/timotheecour/following{/other_user}","gists_url":"https://api.github.com/users/timotheecour/gists{/gist_id}","starred_url":"https://api.github.com/users/timotheecour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timotheecour/subscriptions","organizations_url":"https://api.github.com/users/timotheecour/orgs","repos_url":"https://api.github.com/users/timotheecour/repos","events_url":"https://api.github.com/users/timotheecour/events{/privacy}","received_events_url":"https://api.github.com/users/timotheecour/received_events","type":"User","site_admin":false},"created_at":"2017-02-22T11:18:22Z","updated_at":"2017-02-22T11:18:22Z","body":"@gchatelet:\r\nI was able to get good results using this with when adding `#define _GLIBCXX_USE_CXX11_ABI 0`  but wo this it doesn't wok; but what about supporting c++11 new string abi?\r\nWhat would u recommend?\r\n"}}
{"actor":{"display_login":"timotheecour"}}