{"action":"created","issue":{"url":"https://api.github.com/repos/RaftLib/RaftLib/issues/71","repository_url":"https://api.github.com/repos/RaftLib/RaftLib","labels_url":"https://api.github.com/repos/RaftLib/RaftLib/issues/71/labels{/name}","comments_url":"https://api.github.com/repos/RaftLib/RaftLib/issues/71/comments","events_url":"https://api.github.com/repos/RaftLib/RaftLib/issues/71/events","html_url":"https://github.com/RaftLib/RaftLib/issues/71","id":347435483,"node_id":"MDU6SXNzdWUzNDc0MzU0ODM=","number":71,"title":"Question: are std::string ports supported?","user":{"login":"Cthutu","id":348614,"node_id":"MDQ6VXNlcjM0ODYxNA==","avatar_url":"https://avatars2.githubusercontent.com/u/348614?v=4","gravatar_id":"","url":"https://api.github.com/users/Cthutu","html_url":"https://github.com/Cthutu","followers_url":"https://api.github.com/users/Cthutu/followers","following_url":"https://api.github.com/users/Cthutu/following{/other_user}","gists_url":"https://api.github.com/users/Cthutu/gists{/gist_id}","starred_url":"https://api.github.com/users/Cthutu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cthutu/subscriptions","organizations_url":"https://api.github.com/users/Cthutu/orgs","repos_url":"https://api.github.com/users/Cthutu/repos","events_url":"https://api.github.com/users/Cthutu/events{/privacy}","received_events_url":"https://api.github.com/users/Cthutu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-03T15:13:39Z","updated_at":"2018-08-03T15:21:43Z","closed_at":null,"author_association":"NONE","body":"I've been playing around with raftlib, but I've hit a brick wall when trying to output strings:  Here is my test kernel:\r\n\r\n```C++\r\nclass Sum : public raft::kernel\r\n{\r\npublic:\r\n    Sum()\r\n        : raft::kernel()\r\n    {\r\n        // Define ports\r\n        input.addPort<T>(\"input_a\", \"input_b\");\r\n        output.addPort<std::string>(\"sum\");\r\n    }\r\n\r\n    raft::kstatus run() override\r\n    {\r\n        T a, b;\r\n        input[\"input_a\"].pop(a);\r\n        input[\"input_b\"].pop(b);\r\n\r\n        auto c(output[\"sum\"].template allocate_s<std::string>());\r\n        std::stringstream ss;\r\n        ss << a << \" + \" << b << \" = \" << (a + b) << \" [\" << GetCurrentThreadId() << \"]\\n\";\r\n        *c = ss.str();\r\n\r\n        return raft::proceed;\r\n    }\r\n};\r\n```\r\n\r\nThis crashes inside `map::exe()` after completing the kernels and deallocating memory.  I've tried `allocate` and `send` and that doesn't run at all.\r\n\r\nSo my question is: Are std::string typed ports supported or am I doing something stupid?"},"comment":{"url":"https://api.github.com/repos/RaftLib/RaftLib/issues/comments/410287207","html_url":"https://github.com/RaftLib/RaftLib/issues/71#issuecomment-410287207","issue_url":"https://api.github.com/repos/RaftLib/RaftLib/issues/71","id":410287207,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMDI4NzIwNw==","user":{"login":"Cthutu","id":348614,"node_id":"MDQ6VXNlcjM0ODYxNA==","avatar_url":"https://avatars2.githubusercontent.com/u/348614?v=4","gravatar_id":"","url":"https://api.github.com/users/Cthutu","html_url":"https://github.com/Cthutu","followers_url":"https://api.github.com/users/Cthutu/followers","following_url":"https://api.github.com/users/Cthutu/following{/other_user}","gists_url":"https://api.github.com/users/Cthutu/gists{/gist_id}","starred_url":"https://api.github.com/users/Cthutu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cthutu/subscriptions","organizations_url":"https://api.github.com/users/Cthutu/orgs","repos_url":"https://api.github.com/users/Cthutu/repos","events_url":"https://api.github.com/users/Cthutu/events{/privacy}","received_events_url":"https://api.github.com/users/Cthutu/received_events","type":"User","site_admin":false},"created_at":"2018-08-03T15:21:43Z","updated_at":"2018-08-03T15:21:43Z","author_association":"NONE","body":"OK, further investigation shows that there are problems with assigning `ss,str()` to `c`.  Not sure why that would screw things up.  By replacing `*c = ss.str()` with `*c = \"test\"`, it works.\r\n"}}
{"actor":{"display_login":"Cthutu"}}