Skip to content

klementtan/string_cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ String

This is a header only C++ string implementation that supports Short String Optimisation(SSO) and Copy On Write (COW) for long string. The aim of this repository is for learning purposes that prioritises readability.

Features

  1. Short String Optimisation:
  • No allocation for sting with less than 22 (non-inclusive of \0) characters.
  1. Copy on Write:
  • Lazily copy long string (more than 256 characters) only when writer operations are invoked.
  • Utilises custom lock-free reference counting.
  1. Allow for custom allocator

Build and Testing

Build:

bazel build --cxxopt='-std=c++20' kstring 

Test

bazel test --test_output=streamed kstring_test 

About

C++ String implementation with SSO and COW

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published