#includeint main() { const char* str = "Hello, world!"; const_string::ConstString s(str); std::cout << s << std::endl; return 0; }
#includeint main() { const_string::ConstString s1("Hello"); const_string::ConstString s2("World"); if (s1 == s2) { std::cout << "Strings are equal" << std::endl; } else { std::cout << "Strings are not equal" << std::endl; } return 0; }
#includeThis example demonstrates how to concatenate two ConstString objects into a new one. The ConstString library is a header-only library, meaning that there is no binary package to install. The library is available on Github, and can be added to a C++ project by downloading the header files and including them in the project.int main() { const_string::ConstString s1("Hello"); const_string::ConstString s2("World"); const_string::ConstString s3 = s1 + s2; std::cout << s3 << std::endl; return 0; }