{"action":"created","issue":{"url":"https://api.github.com/repos/insieme/insieme/issues/96","labels_url":"https://api.github.com/repos/insieme/insieme/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/insieme/insieme/issues/96/comments","events_url":"https://api.github.com/repos/insieme/insieme/issues/96/events","html_url":"https://github.com/insieme/insieme/issues/96","id":93457628,"number":96,"title":"Get rid of __insieme_bool_dummy member field","user":{"login":"stefanmoosbrugger","id":8113223,"avatar_url":"https://avatars.githubusercontent.com/u/8113223?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanmoosbrugger","html_url":"https://github.com/stefanmoosbrugger","followers_url":"https://api.github.com/users/stefanmoosbrugger/followers","following_url":"https://api.github.com/users/stefanmoosbrugger/following{/other_user}","gists_url":"https://api.github.com/users/stefanmoosbrugger/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanmoosbrugger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanmoosbrugger/subscriptions","organizations_url":"https://api.github.com/users/stefanmoosbrugger/orgs","repos_url":"https://api.github.com/users/stefanmoosbrugger/repos","events_url":"https://api.github.com/users/stefanmoosbrugger/events{/privacy}","received_events_url":"https://api.github.com/users/stefanmoosbrugger/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/insieme/insieme/labels/frontend","name":"frontend","color":"bfdadc"},{"url":"https://api.github.com/repos/insieme/insieme/labels/minor","name":"minor","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-07T07:13:43Z","updated_at":"2015-07-08T03:48:15Z","closed_at":null,"body":"In order to support async calls that are using lambda \r\nexpressions (e.g., ```std::async([](void) { doSomething(); });```)\r\nI had to introduce a dirty fix that should be removed somehow.\r\n\r\nThe problem is that a lambda expression turns into a struct that\r\nlooks like:\r\n ```\r\nstruct __insieme_lambda {\r\n    //captures\r\n    ...\r\n    //operator(...) member function\r\n    T operator(...) { ... }\r\n};\r\n ```\r\n\r\nIn the end the call to the lambda looks like:\r\n```(__insieme_lambda){ /*capture inits*/ }.operator()(...);```\r\n\r\nThis works fine for structs that contain one or more member fields\r\nbut if we have an empty struct (e.g., lambda that captures nothing) the \r\ncurly bracket initialization results in a compiler error (in this case \r\nthe code looks like: ```(__insieme_lambda){ }.operator()();```).\r\n\r\nTherefore I introduced a boolean dummy member field that \r\nis added to the struct if the lambda would be empty. Unsurprisingly\r\nthis is not a good solution and we should get rid of this thing.\r\nAny ideas how we can fix the empty lambda init without dummy fields?!"},"comment":{"url":"https://api.github.com/repos/insieme/insieme/issues/comments/119414667","html_url":"https://github.com/insieme/insieme/issues/96#issuecomment-119414667","issue_url":"https://api.github.com/repos/insieme/insieme/issues/96","id":119414667,"user":{"login":"HerbertJordan","id":4097849,"avatar_url":"https://avatars.githubusercontent.com/u/4097849?v=3","gravatar_id":"","url":"https://api.github.com/users/HerbertJordan","html_url":"https://github.com/HerbertJordan","followers_url":"https://api.github.com/users/HerbertJordan/followers","following_url":"https://api.github.com/users/HerbertJordan/following{/other_user}","gists_url":"https://api.github.com/users/HerbertJordan/gists{/gist_id}","starred_url":"https://api.github.com/users/HerbertJordan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HerbertJordan/subscriptions","organizations_url":"https://api.github.com/users/HerbertJordan/orgs","repos_url":"https://api.github.com/users/HerbertJordan/repos","events_url":"https://api.github.com/users/HerbertJordan/events{/privacy}","received_events_url":"https://api.github.com/users/HerbertJordan/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T03:48:14Z","updated_at":"2015-07-08T03:48:14Z","body":"This should be very simple to fix in the backend.\r\n\r\nIf you have to initialize an empty struct, you can do something like\r\n```\r\n((empty*)(0))->operator()();\r\n```\r\nwhich should do the trick. This should be a 5-liner. All the constructs you need for that should already be there. "}}