{"action":"created","issue":{"url":"https://api.github.com/repos/boostorg/lexical_cast/issues/22","repository_url":"https://api.github.com/repos/boostorg/lexical_cast","labels_url":"https://api.github.com/repos/boostorg/lexical_cast/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/boostorg/lexical_cast/issues/22/comments","events_url":"https://api.github.com/repos/boostorg/lexical_cast/issues/22/events","html_url":"https://github.com/boostorg/lexical_cast/issues/22","id":235030480,"number":22,"title":"Non-allocating docs are a bit unclear","user":{"login":"vinniefalco","id":1503976,"avatar_url":"https://avatars0.githubusercontent.com/u/1503976?v=3","gravatar_id":"","url":"https://api.github.com/users/vinniefalco","html_url":"https://github.com/vinniefalco","followers_url":"https://api.github.com/users/vinniefalco/followers","following_url":"https://api.github.com/users/vinniefalco/following{/other_user}","gists_url":"https://api.github.com/users/vinniefalco/gists{/gist_id}","starred_url":"https://api.github.com/users/vinniefalco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vinniefalco/subscriptions","organizations_url":"https://api.github.com/users/vinniefalco/orgs","repos_url":"https://api.github.com/users/vinniefalco/repos","events_url":"https://api.github.com/users/vinniefalco/events{/privacy}","received_events_url":"https://api.github.com/users/vinniefalco/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-10T22:25:16Z","updated_at":"2017-06-11T12:00:43Z","closed_at":null,"body":"I would like to make use of lexical_cast into a caller provided buffer, to avoid memory allocation. The documentation implies that conversion into `boost::array<char, ...>` targets will be null terminated but it is not stated explicitly.\r\n\r\nEven so, is there a way to convert to a non-null terminated buffer, and receive the size of the converted result? I would like to avoid a call to char_traits::length."},"comment":{"url":"https://api.github.com/repos/boostorg/lexical_cast/issues/comments/307624782","html_url":"https://github.com/boostorg/lexical_cast/issues/22#issuecomment-307624782","issue_url":"https://api.github.com/repos/boostorg/lexical_cast/issues/22","id":307624782,"user":{"login":"apolukhin","id":1700098,"avatar_url":"https://avatars0.githubusercontent.com/u/1700098?v=3","gravatar_id":"","url":"https://api.github.com/users/apolukhin","html_url":"https://github.com/apolukhin","followers_url":"https://api.github.com/users/apolukhin/followers","following_url":"https://api.github.com/users/apolukhin/following{/other_user}","gists_url":"https://api.github.com/users/apolukhin/gists{/gist_id}","starred_url":"https://api.github.com/users/apolukhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apolukhin/subscriptions","organizations_url":"https://api.github.com/users/apolukhin/orgs","repos_url":"https://api.github.com/users/apolukhin/repos","events_url":"https://api.github.com/users/apolukhin/events{/privacy}","received_events_url":"https://api.github.com/users/apolukhin/received_events","type":"User","site_admin":false},"created_at":"2017-06-11T12:00:43Z","updated_at":"2017-06-11T12:00:43Z","body":"Sorry,  there's no way to avoid call to `char_traits::length`.\r\n\r\nA few more bad news: lexical_cast uses std::locale and will always use it, because dropping it is a breaking change. std::locale is disaster on almost all the platforms: it uses atomics, checks environment variables,  allocates memory, throws and catches exceptions...\r\n\r\nSo, if you need an extremely good performance in that particular case, try to use parser from Boost.Spirit as it does not allocate memory and does not use std::locale OR use std::to_chars/std::from_chars from C++17."}}
{"actor":{"display_login":"apolukhin"}}