C++ Complementary Library
Step 1: Click here to download the latest CCL release (v0.2 Beta).
Step 2: Click here to open the introductory book and learn the basics.
Step 3: Keep being awesome.
Added support for FreeBSD
Added copyright notice property to cmp::application
Added Desktop GUI package
Added support for wide strings
Added std::string_view overload for cmp::string_size
Added a convenience function for getting the application instance pointer
Made char-based strings usable in more contexts
Added support for flushing a stream with the stream insertion operator
Added support for string views to text output streams
Fixed various style-related mistakes
Improved naming of text-related type traits and concepts
Put warning-related flags behind CMP_DEV variable
cmp::application::run is no longer noexcept
Fixed misnaming of configuration constant in application.hpp
Marked functions and classes with CMP_LIBRARY_NAME
where needed
Fixed header-only support when client code is in multiple translation units
Deleted text files that can be created by test programs
Fixed the bug where stream extraction wasn't clearing the target string
Added mixed endianness prohibition to inclusion_assert.hpp
Fixed WinMain issue
Fixed standard I/O synchronization issue
Improved wording of output messages in unicode_stdio_example
CMP_BUILD_STATIC now needs a specific value rather than just needing to be defined or not defined
Before, when building CCL, if you wanted to build CCL as a static library, you had to define the CMP_BUILD_STATIC variable in the CMake configuration command, but it didn't matter what value you set it to, all that mattered was that the variable was defined. Now, to get a static build of CCL, you must define this variable as true. If you don't define it, or if you define it as false, then you'll build CCL as a dynamic library.
wchar_t is now required to be either 2 or 4 bytes long
This requirement did not exist in CCL before, but now CCL requires that wchar_t
be
exactly 2 or 4 bytes long. This is because CCL now supports wchar_t
-based strings
(like std::wstring
, wchar_t*
, etc.) so it just assumes that a 2-byte
wchar_t
means UTF-16 and a 4-byte wchar_t
means UTF-32. If you're on
a platform where this assumption does not hold, then weird things can only happen if you use
wide strings, so the recommendation is that you stick with UTF-8 (that is,
char8_t
-based strings like std::u8string
, char8_t*
, etc.)
as much as possible.
Uses of the term 'string' have been replaced with the term 'text_object' in the names of text-related concepts and type traits
For example, writable_unicode_string
has been renamed to
writable_unicode_text_object
, and raii_unicode_string
has been renamed
to raii_unicode_text_object
, and so on. This is because a lot of times, it wasn't
clear whether the term 'string' was being used to refer to the general idea of a string, or the
std::string
class in the standard library.
Removed support for flush strategies
Because flush strategies have been removed, output streams no longer have the ability to flush the buffer when you write a newline character. This increases performance and forces you to think more about when the buffer should be flushed, both of which are a good thing.
Replaced string I/O resources with container transfer resources
The concept of string I/O resources has been generalized to work with containers that store their elements contiguously. This concept is called container transfer resources. String I/O resources have been removed, and container transfer resources have taken their place. You can now do input and output on containers, not just strings. CCL comes with some predefined type aliases for container transfer resources, they are shown and described in the 2nd edition of the introductory book, available in the 'Documentation' page.
The most straightforward way to upgrade uses of string I/O resources to container transfer resources
is to replace all uses of string I/O resources with opaque container transfer resources that use the
same string type. For example, replace uses of u8string_io_resource
with
opaque_u8string_io_resource
, and replace u16string_io_resource
with
opaque_u16string_io_resource
, and replace u32string_io_resource
with
opaque_u32string_io_resource
. Consult the introductory book for a deeper explanation
of container transfer resources, as there probably is a more suitable type of container transfer
resource for your situation than the ones just mentioned.
Moved cmp::invalid_access_mode to a more appropriate location
The cmp::invalid_access_mode
class was in <cmp/io/general.hpp>
but
moved to <cmp/io/exceptions.hpp>
. So if you need that class and the headers you
included don't already include the header for that class, then include the
<cmp/io/exceptions.hpp>
header.
Renamed cmp::io_buffer::get_data
The cmp::io_buffer
class is used to implement the I/O buffer of transfer resources,
so it is unlikely that users of CCL use this class directly, but in case you do, know that the
get_data
member function has been renamed to get_data_ptr
.
Copyright © 2022-2024 Daniel T. McGinnis