{"id":13721736,"url":"https://github.com/rhysd/FrozenString","last_synced_at":"2025-05-07T14:30:42.681Z","repository":{"id":9773223,"uuid":"11744256","full_name":"rhysd/FrozenString","owner":"rhysd","description":"C++ immutable string library in C++11 constexpr and type-level","archived":false,"fork":false,"pushed_at":"2013-09-13T17:27:18.000Z","size":604,"stargazers_count":19,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T19:54:44.908Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rhysd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-29T16:31:59.000Z","updated_at":"2025-02-06T14:50:17.000Z","dependencies_parsed_at":"2022-07-12T15:03:49.211Z","dependency_job_id":null,"html_url":"https://github.com/rhysd/FrozenString","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2FFrozenString","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2FFrozenString/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2FFrozenString/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2FFrozenString/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhysd","download_url":"https://codeload.github.com/rhysd/FrozenString/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252895472,"owners_count":21821167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T01:01:20.750Z","updated_at":"2025-05-07T14:30:42.287Z","avatar_url":"https://github.com/rhysd.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"## C++ Frozen String Library [![Build Status](https://travis-ci.org/rhysd/FrozenString.png)](https://travis-ci.org/rhysd/FrozenString)\n\nThis library provides string which is constructible in both compile-time and runtime.\n`std::string` is modifiable and not immutable but `frozen::string`\nwhich this library provides is immutable and static.\n\n### Constexpr\n\n```cpp\n#include \"frozen/string.hpp\"\n#include \u003ciostream\u003e\n\nusing frozen::operator\"\" _fstr;\n\n\n// construct string\nconstexpr frozen::string\u003c10\u003e s1 = \"hoge\";\nconstexpr auto s2 = frozen::make_string(\"hoge\");\n\n// immutable!\ns1[0] = 'h'; // error!\n\n// construct from numbers\nconstexpr auto answer = frozen::to_string(42); // from integer\nconstexpr auto pi = frozen::to_string(3.141592); // from floating point\n\n// compare to string\ns1 == frozen::make_string(\"hoge\"); // true\ns1 == \"hoge?\"; // false\n\n// concat strings or numbers\ns1 + frozen::make_string(\"poyo\"); // \"hogepoyo\"\ns1 + \"poyo\"; // \"hogepoyo\"\ns1 + '!'; // \"hoge!\"\ns1 + 42; // \"hoge42\"\ns1 + 3.14; // \"hoge3.14\"\nmake_string(\"Today is \") + 8 + '/' + 5; // \"Today is 8/5\"\n\n// output\nstd::cout \u003c\u003c s1;\n\n// conversion\ns1.data(); // to char const *\ns1.to_std_string(); // to std::string\n\n// user defined literals\n123.45_fstr; // \"123.45\"\n42_fstr; // \"12\"\n\"hoge\"_fstr; // \"hoge\"\nu'ω'_fstr; // \"ω\"\n\n// wide strings for wchar_t, char16_t, char32_t\nfrozen::wstring\u003c13\u003e ws1 = L\"あああ\";\nauto ws2 = frozen::make_string(L\"つらぽよ\");\nauto answer = frozen::to_u16string(3.14);\n```\n\nSee `example` directory to see more examples.\n\n### Template level\n\nUnder construction.\n\n### Compiler Requirements\n\n- gcc : 4.8 or later\n- clang : 3.4 or later\n- Boost.PreProcessor for `frozen::type` template meta functions\n\n### Author\n\n[@Linda_pp](https://twitter.com/Linda_pp)\n\n### License\n\nCopyright (c) 2013 rhysd\n\nDistributed under [the Boost Software License, Version 1.0.](http://www.boost.org/LICENSE_1_0.txt)\n\n    Boost Software License - Version 1.0 - August 17th, 2003\n\n    Permission is hereby granted, free of charge, to any person or organization\n    obtaining a copy of the software and accompanying documentation covered by\n    this license (the \"Software\") to use, reproduce, display, distribute,\n    execute, and transmit the Software, and to prepare derivative works of the\n    Software, and to permit third-parties to whom the Software is furnished to\n    do so, all subject to the following:\n\n    The copyright notices in the Software and this entire statement, including\n    the above license grant, this restriction and the following disclaimer,\n    must be included in all copies of the Software, in whole or in part, and\n    all derivative works of the Software, unless such copies or derivative\n    works are solely in the form of machine-executable object code generated by\n    a source language processor.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n    FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT\n    SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE\n    FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,\n    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n    DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhysd%2FFrozenString","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhysd%2FFrozenString","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhysd%2FFrozenString/lists"}