{"action":"created","issue":{"url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/344","labels_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/344/labels{/name}","comments_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/344/comments","events_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/344/events","html_url":"https://github.com/isocpp/CppCoreGuidelines/issues/344","id":112102698,"number":344,"title":"C.43 implies you should *always* define a constructor?","user":{"login":"thecoshman","id":4427990,"avatar_url":"https://avatars.githubusercontent.com/u/4427990?v=3","gravatar_id":"","url":"https://api.github.com/users/thecoshman","html_url":"https://github.com/thecoshman","followers_url":"https://api.github.com/users/thecoshman/followers","following_url":"https://api.github.com/users/thecoshman/following{/other_user}","gists_url":"https://api.github.com/users/thecoshman/gists{/gist_id}","starred_url":"https://api.github.com/users/thecoshman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thecoshman/subscriptions","organizations_url":"https://api.github.com/users/thecoshman/orgs","repos_url":"https://api.github.com/users/thecoshman/repos","events_url":"https://api.github.com/users/thecoshman/events{/privacy}","received_events_url":"https://api.github.com/users/thecoshman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-19T09:02:03Z","updated_at":"2015-10-29T09:00:21Z","closed_at":null,"body":"It could just be me, but [C.43](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#-c43-give-a-class-a-default-constructor) reads to me like you should *always* define a default constructor. It should be \"ensure a class has a default constructor\", this can either be auto-generated or 'user' defined.\r\n\r\nI think the Data example could be expanded to show how initially having only `Date(int year, int month, day);` would prevent the user in something like a vector, and how providing `Date():year{1970}, month{1}, day{1}{};`  fixes these issues."},"comment":{"url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/comments/152117735","html_url":"https://github.com/isocpp/CppCoreGuidelines/issues/344#issuecomment-152117735","issue_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/344","id":152117735,"user":{"login":"thecoshman","id":4427990,"avatar_url":"https://avatars.githubusercontent.com/u/4427990?v=3","gravatar_id":"","url":"https://api.github.com/users/thecoshman","html_url":"https://github.com/thecoshman","followers_url":"https://api.github.com/users/thecoshman/followers","following_url":"https://api.github.com/users/thecoshman/following{/other_user}","gists_url":"https://api.github.com/users/thecoshman/gists{/gist_id}","starred_url":"https://api.github.com/users/thecoshman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thecoshman/subscriptions","organizations_url":"https://api.github.com/users/thecoshman/orgs","repos_url":"https://api.github.com/users/thecoshman/repos","events_url":"https://api.github.com/users/thecoshman/events{/privacy}","received_events_url":"https://api.github.com/users/thecoshman/received_events","type":"User","site_admin":false},"created_at":"2015-10-29T09:00:21Z","updated_at":"2015-10-29T09:00:21Z","body":"You probably could get away with always explicitly stating your class should have a default constructor, I don't think explicitly stating it changes that constructor (presuming you haven't done something that would normal prevent the default constructor being provided). But that sort of encourages people to be ignorant and not understand why they need it, and we should be aiming to remove the smoke and mirrors.\r\n\r\n@villasv I think that your updated rule is looking good there, but should also have a proper 'good' example, with constructor such as \r\n\r\n    Date():year{1970}, month{1}, day{1}{}\r\n\r\nAnd yes, really month should be an enum thus preventing any arguments about it being zero or one indexed, but that's another debate."}}