{"action":"created","issue":{"url":"https://api.github.com/repos/HowardHinnant/date/issues/82","repository_url":"https://api.github.com/repos/HowardHinnant/date","labels_url":"https://api.github.com/repos/HowardHinnant/date/issues/82/labels{/name}","comments_url":"https://api.github.com/repos/HowardHinnant/date/issues/82/comments","events_url":"https://api.github.com/repos/HowardHinnant/date/issues/82/events","html_url":"https://github.com/HowardHinnant/date/issues/82","id":176642767,"number":82,"title":"Q: any reason for which date:format(fmt, local_time,...) methods take 'timepoint' by value?","user":{"login":"acolomitchi","id":4753647,"avatar_url":"https://avatars.githubusercontent.com/u/4753647?v=3","gravatar_id":"","url":"https://api.github.com/users/acolomitchi","html_url":"https://github.com/acolomitchi","followers_url":"https://api.github.com/users/acolomitchi/followers","following_url":"https://api.github.com/users/acolomitchi/following{/other_user}","gists_url":"https://api.github.com/users/acolomitchi/gists{/gist_id}","starred_url":"https://api.github.com/users/acolomitchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acolomitchi/subscriptions","organizations_url":"https://api.github.com/users/acolomitchi/orgs","repos_url":"https://api.github.com/users/acolomitchi/repos","events_url":"https://api.github.com/users/acolomitchi/events{/privacy}","received_events_url":"https://api.github.com/users/acolomitchi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-09-13T13:38:34Z","updated_at":"2016-09-15T03:09:22Z","closed_at":"2016-09-15T03:09:22Z","body":"I looked into the code and, half-heartedly, I saw/accepted the reason of passing the `std::string fmt` by value.\r\n\r\nBut why the `tp` (timepoint) parameter is by value and not by `const local_time&`?\r\n\r\nAssuming one uses `local_time` vars as data-members of other classes/struct, most of the time a `format(fmt, tp)` call will originate in cases in which the parent struct is subject to 'stringification' - e.g. `operator << (ostream&, const parent_struct& toDump)` - in which cases, the parent struct will be passed 'by const reference'.<br>Yes, of course, one can create a local copy for that `local_time` data member (with optimisation level high enough, it'll be an operation as cheap as creating and init-ing a `long`), but it's... I don't know... say, annoyingly opposite with 'output ops traditions'?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/HowardHinnant/date/issues/comments/247221974","html_url":"https://github.com/HowardHinnant/date/issues/82#issuecomment-247221974","issue_url":"https://api.github.com/repos/HowardHinnant/date/issues/82","id":247221974,"user":{"login":"HowardHinnant","id":6708789,"avatar_url":"https://avatars.githubusercontent.com/u/6708789?v=3","gravatar_id":"","url":"https://api.github.com/users/HowardHinnant","html_url":"https://github.com/HowardHinnant","followers_url":"https://api.github.com/users/HowardHinnant/followers","following_url":"https://api.github.com/users/HowardHinnant/following{/other_user}","gists_url":"https://api.github.com/users/HowardHinnant/gists{/gist_id}","starred_url":"https://api.github.com/users/HowardHinnant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HowardHinnant/subscriptions","organizations_url":"https://api.github.com/users/HowardHinnant/orgs","repos_url":"https://api.github.com/users/HowardHinnant/repos","events_url":"https://api.github.com/users/HowardHinnant/events{/privacy}","received_events_url":"https://api.github.com/users/HowardHinnant/received_events","type":"User","site_admin":false},"created_at":"2016-09-15T03:09:22Z","updated_at":"2016-09-15T03:09:22Z","body":"Closing for now as the primary issue has been addressed.  At this time I don't anticipate creating a `format` which takes an `ostream` and returns `void`.  However feel free to open a new issue on this subject if you desire.  I have now committed additions to `parse`  so that it can be used as described per my comment above.  This alternative syntax is not significantly different performance wise.  It is just an alternative syntax that I like."}}
{"actor":{"display_login":"HowardHinnant"}}