{"id":27310166,"url":"https://github.com/unterumarmung/fixed_string","last_synced_at":"2025-04-12T05:41:11.066Z","repository":{"id":44816829,"uuid":"314216732","full_name":"unterumarmung/fixed_string","owner":"unterumarmung","description":"C++17 string with fixed size","archived":false,"fork":false,"pushed_at":"2022-02-05T09:17:54.000Z","size":1105,"stargazers_count":91,"open_issues_count":13,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-08-08T19:56:45.175Z","etag":null,"topics":["constexpr","cplusplus","cpp-library","cpp-templates","cpp17","cpp17-library","cpp20","header-only","single-file"],"latest_commit_sha":null,"homepage":"https://unterumarmung.github.io/fixed_string/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unterumarmung.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-19T10:44:14.000Z","updated_at":"2023-08-08T08:09:08.000Z","dependencies_parsed_at":"2022-07-21T14:32:35.180Z","dependency_job_id":null,"html_url":"https://github.com/unterumarmung/fixed_string","commit_stats":null,"previous_names":[],"tags_count":2,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unterumarmung%2Ffixed_string","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unterumarmung%2Ffixed_string/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unterumarmung%2Ffixed_string/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unterumarmung%2Ffixed_string/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unterumarmung","download_url":"https://codeload.github.com/unterumarmung/fixed_string/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525162,"owners_count":21118617,"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":["constexpr","cplusplus","cpp-library","cpp-templates","cpp17","cpp17-library","cpp20","header-only","single-file"],"created_at":"2025-04-12T05:41:10.296Z","updated_at":"2025-04-12T05:41:11.052Z","avatar_url":"https://github.com/unterumarmung.png","language":"C++","readme":"# fixed_string\nC++ library that provides a `basic_fixed_string` template that combines `std::array` fixed-size semantic and `std::string` semantic together\n\n## Features\n\n* C++17 or higher\n* Header-only\n* Dependency-free\n* No dynamic allocations\n* Fully constexpr\n* Can be used as class non-type template parameter __(since C++20)__\n\n## Examples\n\n* Construction\n```cpp\nconstexpr fixstr::fixed_string foo = \"foo\";\n```\n\n* Concatenation\n```cpp\nusing namespace fixstr;\nconstexpr fixed_string first = \"Hello, \";\nconstexpr fixed_string second = \"World!\";\nconstexpr auto result = first + second; // \"Hello, World!\"\n```\n\n* Comparison\n```cpp\nusing namespace fixstr;\nconstexpr fixed_string first = \"Hello, \";\nconstexpr fixed_string second = \"World!\";\nstatic_assert(first == second); // false\nstatic_assert(first != second); // true\nstatic_assert(first \u003c second);  // true\nstatic_assert(first \u003c= second); // true\nstatic_assert(first \u003e second);  // false \nstatic_assert(first \u003e= second); // false\nstatic_assert(first \u003c=\u003e second != 0); // true\n```\n\n* Non-type template parameter\n```cpp\ntemplate \u003cfixstr::fixed_string Foo\u003e\nvoid bar()\n{\n    static_assert(Foo == \"foo\"sv);\n}\n\nvoid foo()\n{\n    bar\u003c\"foo\"\u003e();\n}\n```\n\n## Integration\nSince it's a header only library, you need just copy `fixed_string.hpp` to your project.\n\nIf you are using [vcpkg](https://github.com/Microsoft/vcpkg/) on your project for external dependencies, then you can use the [**fixed-string** package](https://github.com/microsoft/vcpkg/tree/master/ports/fixed-string).\n\nIf you are using Conan on your project for external dependencies, then you can use the Conan recipe located in the root of the repository.\n\n## Compiler compatibility\n* GCC \u003e= 7.3\n* Clang \u003e= 5\n* ICC \u003e= 19.0.1\n* MSVC \u003e= 14.28 / Visual Studio 2019 (I don't have access to older VS versions right now, so it can work on older versions too)\n\n**Using `basic_fixed_string` as class non-type template parameter full available in GCC \u003e= 10 and VS 2019 16.9 or newer**\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funterumarmung%2Ffixed_string","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funterumarmung%2Ffixed_string","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funterumarmung%2Ffixed_string/lists"}