{"action":"opened","issue":{"url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/540","repository_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines","labels_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/540/labels{/name}","comments_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/540/comments","events_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/540/events","html_url":"https://github.com/isocpp/CppCoreGuidelines/issues/540","id":138212430,"number":540,"title":"NL.16:  Is initialization order a valid exception to the rule?","user":{"login":"peterpi","id":1045638,"avatar_url":"https://avatars.githubusercontent.com/u/1045638?v=3","gravatar_id":"","url":"https://api.github.com/users/peterpi","html_url":"https://github.com/peterpi","followers_url":"https://api.github.com/users/peterpi/followers","following_url":"https://api.github.com/users/peterpi/following{/other_user}","gists_url":"https://api.github.com/users/peterpi/gists{/gist_id}","starred_url":"https://api.github.com/users/peterpi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterpi/subscriptions","organizations_url":"https://api.github.com/users/peterpi/orgs","repos_url":"https://api.github.com/users/peterpi/repos","events_url":"https://api.github.com/users/peterpi/events{/privacy}","received_events_url":"https://api.github.com/users/peterpi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-03T15:37:00Z","updated_at":"2016-03-03T15:37:00Z","closed_at":null,"body":"NL.16 recommends that members be laid out in `public`, `protected`, `private` order.\r\n\r\nLike many people, I do this as a matter of habit without giving it any second thought.  Sometimes however the _initialization order_ of members requires me to break this rule.\r\n\r\nSomething like:\r\n\r\n    class Foo {\r\n    private:\r\n      int handle;\r\n    public:\r\n      Foo () :\r\n        handle(some_func()),\r\n        width(handle_width(handle)),\r\n        height(handle_height(handle))\r\n      {}\r\n      const int width, height;\r\n    };\r\n\r\n... where `width` and `height`'s initializers require `handle` to be set.\r\n\r\nIs this worth stating as an exception?"}}