{"action":"opened","number":4,"pull_request":{"url":"https://api.github.com/repos/grogers0/CppQuickCheck/pulls/4","id":27972512,"html_url":"https://github.com/grogers0/CppQuickCheck/pull/4","diff_url":"https://github.com/grogers0/CppQuickCheck/pull/4.diff","patch_url":"https://github.com/grogers0/CppQuickCheck/pull/4.patch","issue_url":"https://api.github.com/repos/grogers0/CppQuickCheck/issues/4","number":4,"state":"open","locked":false,"title":"Use refs to prevent order-of-initialization failures","user":{"login":"jgallagher","id":1435635,"avatar_url":"https://avatars.githubusercontent.com/u/1435635?v=3","gravatar_id":"","url":"https://api.github.com/users/jgallagher","html_url":"https://github.com/jgallagher","followers_url":"https://api.github.com/users/jgallagher/followers","following_url":"https://api.github.com/users/jgallagher/following{/other_user}","gists_url":"https://api.github.com/users/jgallagher/gists{/gist_id}","starred_url":"https://api.github.com/users/jgallagher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgallagher/subscriptions","organizations_url":"https://api.github.com/users/jgallagher/orgs","repos_url":"https://api.github.com/users/jgallagher/repos","events_url":"https://api.github.com/users/jgallagher/events{/privacy}","received_events_url":"https://api.github.com/users/jgallagher/received_events","type":"User","site_admin":false},"body":"I ran into some very weird runtime errors (exceptions about trying to call empty `boost::function`s) using CppQuickCheck on Mac OS X (can supply more detail about tool/OS versions if you'd like). After some spelunking, I tried adding this before calling any cppqc functions:\r\n\r\n```c++\r\nstd::cout << Arbitrary<int>::unGen.empty() << \"\\n\";\r\nstd::cout << ArbitraryImpl<int>::unGen.empty() << \"\\n\";\r\n```\r\n\r\nand much to my surprise, it printed \"0 1\". I'm a little out of my depth, but I think maybe this is an \"order of initialization is undefined\" issue, because I was able to run the examples without problems.\r\n\r\nThis PR fixes the issue by making `Arbitrary<T>::unGen` (and shrink) be references to `ArbitraryImpl<T>::unGen` (and shrink) instead of copies. I'm only just now starting to experiment with cppqc, so I'm not sure if this could cause other problems or if there's a better way to solve the problem.","created_at":"2015-01-24T06:15:57Z","updated_at":"2015-01-24T06:15:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/grogers0/CppQuickCheck/pulls/4/commits","review_comments_url":"https://api.github.com/repos/grogers0/CppQuickCheck/pulls/4/comments","review_comment_url":"https://api.github.com/repos/grogers0/CppQuickCheck/pulls/comments/{number}","comments_url":"https://api.github.com/repos/grogers0/CppQuickCheck/issues/4/comments","statuses_url":"https://api.github.com/repos/grogers0/CppQuickCheck/statuses/7ae4b63a52d63fcf829674fa28930c3c8ed47b63","head":{"label":"jgallagher:master","ref":"master","sha":"7ae4b63a52d63fcf829674fa28930c3c8ed47b63","user":{"login":"jgallagher","id":1435635,"avatar_url":"https://avatars.githubusercontent.com/u/1435635?v=3","gravatar_id":"","url":"https://api.github.com/users/jgallagher","html_url":"https://github.com/jgallagher","followers_url":"https://api.github.com/users/jgallagher/followers","following_url":"https://api.github.com/users/jgallagher/following{/other_user}","gists_url":"https://api.github.com/users/jgallagher/gists{/gist_id}","starred_url":"https://api.github.com/users/jgallagher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgallagher/subscriptions","organizations_url":"https://api.github.com/users/jgallagher/orgs","repos_url":"https://api.github.com/users/jgallagher/repos","events_url":"https://api.github.com/users/jgallagher/events{/privacy}","received_events_url":"https://api.github.com/users/jgallagher/received_events","type":"User","site_admin":false},"repo":{"id":29767489,"name":"CppQuickCheck","full_name":"jgallagher/CppQuickCheck","owner":{"login":"jgallagher","id":1435635,"avatar_url":"https://avatars.githubusercontent.com/u/1435635?v=3","gravatar_id":"","url":"https://api.github.com/users/jgallagher","html_url":"https://github.com/jgallagher","followers_url":"https://api.github.com/users/jgallagher/followers","following_url":"https://api.github.com/users/jgallagher/following{/other_user}","gists_url":"https://api.github.com/users/jgallagher/gists{/gist_id}","starred_url":"https://api.github.com/users/jgallagher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgallagher/subscriptions","organizations_url":"https://api.github.com/users/jgallagher/orgs","repos_url":"https://api.github.com/users/jgallagher/repos","events_url":"https://api.github.com/users/jgallagher/events{/privacy}","received_events_url":"https://api.github.com/users/jgallagher/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jgallagher/CppQuickCheck","description":"QuickCheck-like property based automated testing tool for C++","fork":true,"url":"https://api.github.com/repos/jgallagher/CppQuickCheck","forks_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/forks","keys_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/teams","hooks_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/hooks","issue_events_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/issues/events{/number}","events_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/events","assignees_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/assignees{/user}","branches_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/branches{/branch}","tags_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/tags","blobs_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/git/refs{/sha}","trees_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/statuses/{sha}","languages_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/languages","stargazers_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/stargazers","contributors_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/contributors","subscribers_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/subscribers","subscription_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/subscription","commits_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/commits{/sha}","git_commits_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/git/commits{/sha}","comments_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/comments{/number}","issue_comment_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/issues/comments/{number}","contents_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/contents/{+path}","compare_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/merges","archive_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/downloads","issues_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/issues{/number}","pulls_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/pulls{/number}","milestones_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/milestones{/number}","notifications_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/labels{/name}","releases_url":"https://api.github.com/repos/jgallagher/CppQuickCheck/releases{/id}","created_at":"2015-01-24T06:06:29Z","updated_at":"2015-01-24T06:09:13Z","pushed_at":"2015-01-24T06:09:13Z","git_url":"git://github.com/jgallagher/CppQuickCheck.git","ssh_url":"git@github.com:jgallagher/CppQuickCheck.git","clone_url":"https://github.com/jgallagher/CppQuickCheck.git","svn_url":"https://github.com/jgallagher/CppQuickCheck","homepage":"","size":229,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"grogers0:master","ref":"master","sha":"d3b1a16b3c49540dcb3b08b83b30f9a60a3ac9a6","user":{"login":"grogers0","id":71939,"avatar_url":"https://avatars.githubusercontent.com/u/71939?v=3","gravatar_id":"","url":"https://api.github.com/users/grogers0","html_url":"https://github.com/grogers0","followers_url":"https://api.github.com/users/grogers0/followers","following_url":"https://api.github.com/users/grogers0/following{/other_user}","gists_url":"https://api.github.com/users/grogers0/gists{/gist_id}","starred_url":"https://api.github.com/users/grogers0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grogers0/subscriptions","organizations_url":"https://api.github.com/users/grogers0/orgs","repos_url":"https://api.github.com/users/grogers0/repos","events_url":"https://api.github.com/users/grogers0/events{/privacy}","received_events_url":"https://api.github.com/users/grogers0/received_events","type":"User","site_admin":false},"repo":{"id":995617,"name":"CppQuickCheck","full_name":"grogers0/CppQuickCheck","owner":{"login":"grogers0","id":71939,"avatar_url":"https://avatars.githubusercontent.com/u/71939?v=3","gravatar_id":"","url":"https://api.github.com/users/grogers0","html_url":"https://github.com/grogers0","followers_url":"https://api.github.com/users/grogers0/followers","following_url":"https://api.github.com/users/grogers0/following{/other_user}","gists_url":"https://api.github.com/users/grogers0/gists{/gist_id}","starred_url":"https://api.github.com/users/grogers0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grogers0/subscriptions","organizations_url":"https://api.github.com/users/grogers0/orgs","repos_url":"https://api.github.com/users/grogers0/repos","events_url":"https://api.github.com/users/grogers0/events{/privacy}","received_events_url":"https://api.github.com/users/grogers0/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/grogers0/CppQuickCheck","description":"QuickCheck-like property based automated testing tool for C++","fork":false,"url":"https://api.github.com/repos/grogers0/CppQuickCheck","forks_url":"https://api.github.com/repos/grogers0/CppQuickCheck/forks","keys_url":"https://api.github.com/repos/grogers0/CppQuickCheck/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grogers0/CppQuickCheck/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grogers0/CppQuickCheck/teams","hooks_url":"https://api.github.com/repos/grogers0/CppQuickCheck/hooks","issue_events_url":"https://api.github.com/repos/grogers0/CppQuickCheck/issues/events{/number}","events_url":"https://api.github.com/repos/grogers0/CppQuickCheck/events","assignees_url":"https://api.github.com/repos/grogers0/CppQuickCheck/assignees{/user}","branches_url":"https://api.github.com/repos/grogers0/CppQuickCheck/branches{/branch}","tags_url":"https://api.github.com/repos/grogers0/CppQuickCheck/tags","blobs_url":"https://api.github.com/repos/grogers0/CppQuickCheck/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grogers0/CppQuickCheck/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grogers0/CppQuickCheck/git/refs{/sha}","trees_url":"https://api.github.com/repos/grogers0/CppQuickCheck/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grogers0/CppQuickCheck/statuses/{sha}","languages_url":"https://api.github.com/repos/grogers0/CppQuickCheck/languages","stargazers_url":"https://api.github.com/repos/grogers0/CppQuickCheck/stargazers","contributors_url":"https://api.github.com/repos/grogers0/CppQuickCheck/contributors","subscribers_url":"https://api.github.com/repos/grogers0/CppQuickCheck/subscribers","subscription_url":"https://api.github.com/repos/grogers0/CppQuickCheck/subscription","commits_url":"https://api.github.com/repos/grogers0/CppQuickCheck/commits{/sha}","git_commits_url":"https://api.github.com/repos/grogers0/CppQuickCheck/git/commits{/sha}","comments_url":"https://api.github.com/repos/grogers0/CppQuickCheck/comments{/number}","issue_comment_url":"https://api.github.com/repos/grogers0/CppQuickCheck/issues/comments/{number}","contents_url":"https://api.github.com/repos/grogers0/CppQuickCheck/contents/{+path}","compare_url":"https://api.github.com/repos/grogers0/CppQuickCheck/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grogers0/CppQuickCheck/merges","archive_url":"https://api.github.com/repos/grogers0/CppQuickCheck/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grogers0/CppQuickCheck/downloads","issues_url":"https://api.github.com/repos/grogers0/CppQuickCheck/issues{/number}","pulls_url":"https://api.github.com/repos/grogers0/CppQuickCheck/pulls{/number}","milestones_url":"https://api.github.com/repos/grogers0/CppQuickCheck/milestones{/number}","notifications_url":"https://api.github.com/repos/grogers0/CppQuickCheck/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grogers0/CppQuickCheck/labels{/name}","releases_url":"https://api.github.com/repos/grogers0/CppQuickCheck/releases{/id}","created_at":"2010-10-17T22:11:17Z","updated_at":"2015-01-18T11:46:46Z","pushed_at":"2015-01-04T04:28:41Z","git_url":"git://github.com/grogers0/CppQuickCheck.git","ssh_url":"git@github.com:grogers0/CppQuickCheck.git","clone_url":"https://github.com/grogers0/CppQuickCheck.git","svn_url":"https://github.com/grogers0/CppQuickCheck","homepage":"","size":229,"stargazers_count":30,"watchers_count":30,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":2,"forks":7,"open_issues":2,"watchers":30,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/grogers0/CppQuickCheck/pulls/4"},"html":{"href":"https://github.com/grogers0/CppQuickCheck/pull/4"},"issue":{"href":"https://api.github.com/repos/grogers0/CppQuickCheck/issues/4"},"comments":{"href":"https://api.github.com/repos/grogers0/CppQuickCheck/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/grogers0/CppQuickCheck/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/grogers0/CppQuickCheck/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/grogers0/CppQuickCheck/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/grogers0/CppQuickCheck/statuses/7ae4b63a52d63fcf829674fa28930c3c8ed47b63"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":4,"deletions":4,"changed_files":1}}