Changelog
Changes since 2020.06
Dependency changes
- Minimal supported CMake version is now 3.5, changed from 3.4, since CMake 3.27+ warns if a compatibility with CMake below 3.5 is requested. Older versions are not supported anymore and all workarounds for them were removed. This is a conservative change, as there are no known supported distributions which would have anything older than 3.5.
New features
- MSVC 2022 support. For that there's a new CORRADE_
MSVC_ COMPATIBILITY flag that controls workarounds for MSVC 2019+ with the /permissive-
flag not enabled. This supersedes theCORRADE_MSVC2019_COMPATIBILITY
flag and can be turned off if/permissive-
is set for all files that use Corrade. See also mosra/corrade#124. - New CORRADE_
TARGET_ WASM preprocessor variable for any (even non-Emscripten) WebAssembly target, as a complement to CORRADE_ TARGET_ X86, CORRADE_ TARGET_ ARM and CORRADE_ TARGET_ POWERPC - New CORRADE_
TARGET_ SSE3, CORRADE_ TARGET_ SSSE3, CORRADE_ TARGET_ SSE41, CORRADE_ TARGET_ SSE42, CORRADE_ TARGET_ POPCNT, CORRADE_ TARGET_ LZCNT, CORRADE_ TARGET_ BMI1, CORRADE_ TARGET_ BMI2, CORRADE_ TARGET_ AVX, CORRADE_ TARGET_ AVX_ F16C, CORRADE_ TARGET_ AVX_ FMA, CORRADE_ TARGET_ AVX2, CORRADE_ TARGET_ AVX512F, CORRADE_ TARGET_ NEON, CORRADE_ TARGET_ NEON_ FMA, CORRADE_ TARGET_ NEON_ FP16 and CORRADE_ TARGET_ SIMD128 preprocessor variables added to the already existing CORRADE_ TARGET_ SSE2 for detecting enabled instruction sets on x86, ARM and WebAssembly - New CORRADE_
TARGET_ 32BIT preprocessor variable for cross-platform detection of 32-bit builds - New CORRADE_
TARGET_ CXX14, CORRADE_ TARGET_ CXX17 and CORRADE_ TARGET_ CXX20 convenience macros that provide an easier way to detect used C++ standard than comparing CORRADE_ CXX_ STANDARD to some arbitrary value - New Cpu namespace that provides building blocks for compile-time and runtime CPU feature detection and dispatch on x86, ARM and WebAssembly. See mosra/
corrade#115, mosra/ corrade#154 and mosra/ corrade#171. - Added MSVC Natvis files and pretty-printers for GDB. See Debugger support, mosra/
corrade#111, mosra/ corrade#147, mosra/ corrade#160, mosra/ corrade#165, mosra/ corrade#172 and mosra/ corrade#179 for more information. - For console applications, the Corrade::
Main library now disables showing an assertion dialog on Windows, making them either jump to the debugger or exit directly. This fixes a problem in non-interactive scenarios where assertions caused the apps to get stuck forever waiting for someone to close the dialog.
Containers library
- New Containers::
ArrayTuple class for coalescing arrays of homogeneous types and varying lengths into a single allocation. See also mosra/ magnum#505, mosra/ corrade#116 and mosra/ corrade#117. - New Containers::
BigEnumSet class for storing enum sets with more than 64 values - New Containers::
BitArray, Containers:: BitArrayView and Containers:: StridedBitArrayView classes for owning and non-owning containers of bits, and a new Containers:: StridedArrayView:: sliceBit() helper for easily creating bit views on complex data - New Containers::
Function class for generic function wrappers - New Containers::
Iterable helper to provide an indirection for iterating over both containers of values and containers of references in a single code path, and a Containers:: StringIterable doing the same for strings, string views and plain char*
. - New Containers::
Pair and Containers:: Triple classes that fix various issues and pitfalls of std:: pair and provide a lightweight alternative to a three-element std:: tuple - New Containers::
String class as a lightweight but more flexible alternative to std:: string - New Containers::
StringView class as a lightweight but more flexible alternative to C++17 std:: string_view. See also mosra/ corrade#123 and mosra/ corrade#171. - New Containers::
MoveReference and Containers:: AnyReference counterparts to Containers:: Reference for exclusively r-value references and both l-value and r-value references - Added a Containers::
StridedArrayView:: slice() overload for slicing into struct
members andclass
getter functions - Added Containers::
StridedArrayView:: expanded() and StridedArrayView:: collapsed() view transformation functions for expanding a dimension to multiple dimensions and collapsing them back - New Containers::
Array2, Containers:: Array3 and Containers:: Array4 convenience aliases for Containers:: StaticArray, together with Containers:: Array1 that's useful in case you want to take advantage of the NoInit tag on an arbitrary type and Containers:: Optional doesn't suit the use case. - New Containers::
ArrayView2, Containers:: ArrayView3 and Containers:: ArrayView4 convenience aliases for Containers:: StaticArrayView - Added a family of Containers::
arrayInsert(), Containers:: arrayRemove() and Containers:: arrayRemoveUnordered() functions for arbitrary insertion into and deletion from growable arrays - Support for C++17 structured bindings for Containers::
Pair, Containers:: Triple, Containers:: StaticArray, Containers:: StaticArrayView and Containers:: StridedDimensions. See also mosra/ corrade#127, mosra/ corrade#157 and mosra/ corrade#159.
PluginManager library
- The PluginManager library is now free of std::
string and std:: vector usage in all its public APIs except the PluginManager:: PluginMetadata class. Containers:: StringView, Containers:: String, Containers:: ArrayView and Containers:: Array is used instead, resulting in much less temporary allocations and better compile times. - New PluginManager::
Manager:: externalManager() API to allow plugins to list, access and instantiate plugins of other types
TestSuite library
- The TestSuite library is now completely free of all std::
string usage in its public APIs, using only Containers:: StringView, Containers:: String or even just plain const char*
where compile times really matter - New CORRADE_
INFO(), CORRADE_ WARN(), CORRADE_ FAIL() and CORRADE_ FAIL_ IF() macros for printing formatted information to the output and explicitly failing a test - New CORRADE_
SKIP_ IF_ NO_ ASSERT() and CORRADE_ SKIP_ IF_ NO_ DEBUG_ ASSERT() helper macros for easier assertion testing - New TestSuite::
Compare:: NotEqual comparator to provide an alternative to CORRADE_VERIFY(a != b)
with a better failure diagnostic - New TestSuite::
Compare:: String comparator that prints a colored line diff on failure (see also mosra/ corrade#38) - New TestSuite::
Compare:: StringHasPrefix, StringHasSuffix, StringContains and StringNotContains comparators to provide an alternative to CORRADE_VERIFY(a.hasPrefix(b))
and similar with a better failure diagnostic - New TestSuite::
Compare:: Aligned and NotAligned comparators as a more convenient alternative to TestSuite:: Compare:: Divisible and NotDivisible when dealing with pointers - New TestSuite::
TestCaseDescriptionSourceLocation helper for improved file/line info in instanced test cases
Utility library
- New Utility::
flipInPlace() algorithm for in-place flipping of strided array views - New Corrade/
Utility/ BitAlgorithms.h header with Utility:: copyMasked() and other algorithms that use the new Containers:: BitArrayView containers - Utility::
allocateAligned() family of functions for overaligned allocations, suitable for efficient SIMD operations - Added Utility::
forward(), Utility:: move() and Utility:: swap() equivalents to std:: forward(), std:: move() and std:: swap() without having to pull in everything else from #include <utility>
. - Added Utility::
Arguments:: addArrayArgument() as a positional counterpart to Utility:: Arguments:: addArrayOption() - Utility::
Configuration and Utility:: Arguments can now read and write Containers:: String and Containers:: StringView values, Utility:: ConfigurationValue can be implemented using those instead of std:: string as well - Utility::
ConfigurationGroup gained an ability to iterate through its values and subgroups using values() and groups() - New Utility::
Debug:: invertedColor() output modifier for printing colored text with the foreground and background colors inverted - New Utility::
Debug:: hex output modifier for printing integers as hexadecimal. See also mosra/ magnum#544. - New Corrade::
Utility:: Json class for tokenizing and parsing JSON files into an immutable memory-efficient representation. See also mosra/ corrade#174. - New Corrade::
Utility:: JsonWriter class for stream-like writing and pretty-printing of JSON files - New Corrade/
Utility/ Math.h header implementing Utility:: min(), Utility:: max() and Utility:: abs() because having to #include <algorithm>
to get std::min() and std:: max() is unacceptable, and similarly but less so for #include <cmath>
to get std::abs() - New Utility::
Path:: lastModification() query, extracted out of Utility:: FileWatcher to a standalone utility - Utility::
Resource and corrade-rc is now capable of optional making resources null-terminated and arbitrarily aligned - Added Utility::
String:: lowercaseInPlace() and uppercaseInPlace() together with Utility:: String:: lowercase() and uppercase() overloads taking a Containers:: StringView . New Utility:: String:: commonPrefix() utility to return the longest common prefix of two strings - New Utility::
String:: parseNumberSequence() utility for parsing number sequences such as 1-3,5,17
, useful especially for convenient command-line APIs - New Utility::
Unicode:: currentChar() utility for finding a start of a UTF-8 sequence - New CORRADE_
INTERNAL_ ASSERT_ EXPRESSION() macro for assertions that can be evaluated directly inside larger expressions - New CORRADE_
DEBUG_ ASSERT(), CORRADE_ CONSTEXPR_ DEBUG_ ASSERT(), CORRADE_ DEBUG_ ASSERT_ OUTPUT(), CORRADE_ DEBUG_ ASSERT_ UNREACHABLE(), CORRADE_ INTERNAL_ DEBUG_ ASSERT(), CORRADE_ INTERNAL_ CONSTEXPR_ DEBUG_ ASSERT(), CORRADE_ INTERNAL_ DEBUG_ ASSERT_ OUTPUT(), CORRADE_ INTERNAL_ DEBUG_ ASSERT_ EXPRESSION() and CORRADE_ INTERNAL_ DEBUG_ ASSERT_ UNREACHABLE() macros that expand to their non- DEBUG
counterparts on debug builds and get compiled out on release builds; as well as a CORRADE_NO_ DEBUG_ ASSERT define for querying if debug assertions are enabled. See also mosra/ corrade#136. - New CORRADE_
LIKELY() and CORRADE_ UNLIKELY() macros for instruction cache microoptimizations in tight loops - New CORRADE_
PASSTHROUGH() helper macro, an inverse of CORRADE_ NOOP() - New CORRADE_
CONSTEXPR20 macro, a variant of CORRADE_ CONSTEXPR14 for C++20 - New Corrade/
Utility/ StlForwardTupleSizeElement.h header for forward-declaring std:: tuple_size and std:: tuple_element without having to #include <utility>
or other heavy STL headers. See also mosra/corrade#127. - Added a
--single
option to the corrade-rc executable as well as corrade_add_ resource(... SINGLE) for compiling a single input file into a C++ file containing its binary representation
Changes and improvements
Containers library
- Assertions in often-called element access and slicing APIs were converted to CORRADE_
DEBUG_ ASSERT() and friends, meaning they get compiled out on release builds for better performance. Complex array casting and slicing functionality that's prone to user errors still keeps CORRADE_ ASSERT() as these functions are not meant to be called in tight loops and the value of safety guarantees outweighs negative performance effects. - Containers::
ArrayView:: front(), Containers:: ArrayView:: back(), Containers:: StaticArrayView:: front() and Containers:: StaticArrayView:: back() is now constexpr
like all other access APIs - A new convenience Containers::
Array:: Array(ArrayView<T>, D) overload for constructing non-owned Containers:: Array instances from existing views - Added Containers::
arrayShrink(Array<T>&, DefaultInitT) overload for cases where it's not desired to have an Containers:: Array with a NoInit
deleter - Added Containers::
arrayResize(Array<T>&, std:: size_t, const typename std:: common_type<T>:: type&) as a convenience shorthand for Containers:: arrayResize(Array<T>&, DirectInitT, std:: size_t, Args&&... args) - Containers::
arrayAppend(Array<T>&, typename std:: common_type<ArrayView<const T>>:: type) and Containers:: arrayAppend(Array<T>&, NoInitT, std:: size_t) are now no-op in case the item count is zero - Added a Containers::
EnumSet:: EnumSet(UnderlyingType) constructor to match how builtin enum
can be explictly constructed from its underlying integer representation - Added an ability to construct a Containers::
StridedArrayView1D from a pointer and size, the same way as with contiguous array views - Added Containers::
StaticArray:: StaticArray(InPlaceInitT, const T(&)[size]) and Containers:: StaticArray:: StaticArray(InPlaceInitT, T(&&)[size]) for more convenience with in-place creation of arrays of complex types. - Added a Containers::
StridedArrayView constructor from a strided view with less dimensions - Added a Containers::
stridedArrayView(ArrayView<T>, std:: size_t, std:: ptrdiff_t) helper to complement Containers:: stridedArrayView(ArrayView<typename StridedArrayView1D<T>:: ErasedType>, T*, std:: size_t, std:: ptrdiff_t) - Containers::
Array:: Array(InPlaceInitT, std:: initializer_list<T>) constructor is no longer explicit
to allow for easier use in initializer lists - Added a Containers::
Pointer<T>:: emplace<U>() overload for in-place construction of a derived type - Containers::
ScopeGuard now has a NoCreate constructor and is movable in order to support deferred creation - Added a templated overload of Containers::
StridedArrayView:: asContiguous() that flattens the view only from given dimension further, returning a StridedArrayView again - Containers::
LinkedList destruction was changed in a way that makes Containers:: LinkedListItem:: list() still accessible in a destructor of Containers:: LinkedListItem subclasses - Containers::
Pointer, Containers:: Optional, Containers:: Reference, Containers:: MoveReference and Containers:: AnyReference gained a Type member typedef for consistency with other containers - Containers::
StridedArrayView can now be used in STL algorithms such as std:: lower_bound() if you include Corrade/ Containers/ StridedArrayViewStl.h - Added Containers::
StridedArrayView:: operator[](const Containers:: Size<dimensions>&) const for directly accessing individual elements in multi-dimensional views - Added convenience Containers::
Size, Containers:: Size1D, Containers:: Size2D, Containers:: Size3D, Containers:: Size4D, Containers:: Stride, Containers:: Stride1D, Containers:: Stride2D, Containers:: Stride3D and Containers:: Stride4D aliases for Containers:: StridedDimensions - All classes that have a constructor taking a single pointer or std::
nullptr_t argument now prevent ambiguity when used in function overloads together with an integer argument and called with 0
- Containers::
StaticArray of types that are either trivially constructible or have a NoInit constructor are now usable in constexpr
contexts and trivially copyable if the underlying type is
PluginManager library
- The
corrade_add_plugin()
andcorrade_add_static_plugin()
CMake macros now allow the metadata file path to be absolute as well, which is useful when the file has the contents generated.
TestSuite library
- Added a TestSuite::
Tester:: testName() getter, used by Magnum Vulkan tests to provide application name for each executable - New TestSuite::
Tester:: setTestCaseTemplateName() overload taking a list of strings for test cases templated by more than one parameter - The CORRADE_
VERIFY() macro now now accepts varargs, meaning that you no longer need to wrap expressions containing commas in extra parentheses - The CORRADE_
SKIP(), CORRADE_ EXPECT_ FAIL() and CORRADE_ EXPECT_ FAIL_ IF() macros now accept messages in the same form as CORRADE_ ASSERT(), that is anything that can be printed with Utility:: Debug as well as chaining the pieces with <<
. - Test executables now accept
-X
and-S
as a shorthand to often used--abort-on-fail
and--save-diagnostic
command-line options - When the
--no-catch
option is passed, TestSuite::Tester doesn't rethrow exceptions derived from std:: exception but instead lets them go directly to make the backtrace point to the original exception location and not to where it got rethrown from. - The
--skip
and--only
TestSuite::Tester options now accept a more flexible syntax from Utility:: String:: parseNumberSequence(), allowing arbitrary ranges to be specified in a succint way - TestSuite::
Compare:: SortedContainer can now work with non-copyable containers (such as Containers:: Array) and containers without random access (such as std:: list or std:: unordered_map). - Added TestSuite::
Tester:: BenchmarkUnits:: RatioThousandths and PercentageThousandths for benchmarks that output fractional values and percentages
Utility library
- Utility::
Arguments can now recognize short options packed together (e.g. -xzOfile.dat
is equivalent to-x -z -O file.dat
providing-x
and-z
are boolean options) - Utility::
Arguments now recognizes long options in the --option=value
form in addition to--option value
, and there's a related new Utility::Arguments:: ParseError:: InvalidBooleanOption error state. - Removed unnecessarily excessive
char**
overloads in Utility::Arguments in favor of a single one (see mosra/ corrade#) - New Utility::
copy(std:: initializer_list<typename ToView:: Type>, To&&) overload for easy populating of arrays and views !Debug{}
or source location output in Debug is now enabled on MSVC 2019 16.6+ as well, making it available across all compilers- Utility::
Debug now accepts also a C++17 std:: string_view if you include Corrade/ Utility/ DebugStlStringView.h - Improved error handling in Utility::
Path APIs where all APIs now consistently print an error code and message coming from the system on failure instead of a generic message or nothing at all. See also mosra/ corrade#164. - Utility::
Path:: isDirectory() now follows symlinks on Unix platforms - Utility::
Path:: ListFlag:: SkipFiles and Utility:: Path:: ListFlag:: SkipDirectories passed to Utility:: Path:: list() now affects symlinks as well — previously they were treated as neither, now they get correctly skipped based on whether the target is a file or a directory - Utility::
Path:: ListFlag:: SkipSpecial passed to Utility:: Path:: list() now has no effect on Emscripten, the same as on Windows, as those two platforms have no notion of a special file. Previously this behaved equivalently to Utility:: Path:: ListFlag:: SkipFiles on Emscripten but that made no sense from a portability point of view. - Utility::
Path:: size(), read() and copy() now explicitly check if the path is a directory and fail in that case, instead of returning nonsense, crashing on an allocation failure or silently doing the wrong thing - Implemented Utility::
Path:: executableLocation() on FreeBSD (see mosra/ corrade#171 and mosra/ corrade#183) - Added Utility::
Resource:: hasFile() as a counterpart to Utility:: Resource:: hasGroup() for querying whether a filename is contained in a resource group - Utility::
format() now supports printing integers as characters using the "{:c}"
modifier - Utility::
format() now accepts also a C++17 std:: string_view if you include Corrade/ Utility/ FormatStlStringView.h - Utility::
String:: split() and Utility:: String:: splitWithoutEmptyParts() now have Containers:: StringView overloads that allocate much less - Added a Utility::
String:: replaceAll(Containers:: String, char, char) overload for more optimal single-character replacement and a Utility:: String:: replaceAllInPlace(Containers:: MutableStringView, char, char) variant that can work on existing memory - Ability to print Containers::
BasicStringView and Containers:: String using Utility:: format() - Creating an empty path with Utility::
Path:: make() now succeeds because it makes no sense to fail for such case - Unless querying file types is unreliable on given platform, Utility::
Path:: make() now fails if the path already exists and is a file - Utility::
IsStringLike now recognizes also C++17 std:: string_view by checking for a substr()
member instead ofc_str()
- The CORRADE_
LONG_ DOUBLE_ SAME_ AS_ DOUBLE macro is now defined on Emscripten always, because even if it's long double
is 80-bit sometimes, it doesn't actually have the precision of a 80-bit representation - The CORRADE_
FALLTHROUGH macro is implemented on MSVC 2019 16.6 if compiling as C++17. - The CORRADE_
ASSUME() macro now uses __attribute__((assume))
on GCC 13+, which should lead to better optimization opportunities compared toif(!(condition)) __builtin_unreachable()
- Minor exception guarantee improvements (see mosra/
corrade#148)
Build system
- The library now uses
-fno-strict-aliasing
on GCC and enables this flag for all CMake users as well, independently of whether theCORRADE_USE_PEDANTIC_FLAGS
CMake option is enabled. Strict aliasing was disabled for the Magnum library since 2013 already, this change just enables it for all Magnum-related projects because essential functionality like Containers::StridedArrayView is impossible to implement without breaking strict aliasing rules. - The oldest supported Clang version is now 6.0 (available on Ubuntu 18.04), or equivalently Apple Clang 10.0 (Xcode 10). Oldest supported GCC version is still 4.8.
- The
-o
option in the Single-header generator tool utility now treats the argument as a file if it doesn't exist and a directory only if it exists and is a directory (see mosra/corrade#90) - Fixed a potential error in
UseCorrade.cmake
that would happen when compiling with an unrecognized compiler (see mosra/magnum#457) - The
version.h
header now gets populated from Git correctly also when inside a CMake subproject - The
corrade_add_test()
,corrade_add_plugin()
,corrade_add_static_plugin()
andcorrade_add_resource()
CMake functions now check for presence of the targets they depend on, giving the user a clear message in case something is missing (see mosra/corrade#101) - Attempted a switch of Emscripten build on Travis CI from macOS to Ubuntu + Docker for 2x faster build times in a futile attempt to not use the extremely expensive features of a no-longer-free service. Ultimately, Travis banned everyone from using their CI and so all Linux, macOS, Emscripten, Android and iOS builds were migrated from Travis to Circle CI, together with adding also an explicit ARM64 build. See mosra/
corrade#105, mosra/ magnum#350 and mosra/ magnum#523. - On CMake 3.16 and newer,
FindCorrade.cmake
can provide additional details if some component is not found - The Homebrew package now uses
std_cmake_args
instead of hardcoded build type and install prefix, which resolves certain build issues (see mosra/homebrew-magnum#6) - CORRADE_
DEPRECATED_ ENUM() is now a no-op for Qt's Meta Object Compiler as it caused parse errors on older Qt versions - With CMake 3.20 and newer it's possible to compile for Android NDK r19+ without explicitly supplying various system paths. Additionally, when
CMAKE_INSTALL_PREFIX
points to Android NDK sysroot, theLIB_SUFFIX
gets autodetected to a correct triplet + API level version subdirectory, making the installed project discoverable by both vanilla CMake and Gradle. On CMake 3.16 to 3.19 it's required to set two extra variables for the same effect. See Cross-compiling for Android and mosra/magnum#310 for more information. - Updated Debian build instructions to pass
--no-sign
todpkg-buildpackage
, avoiding a confusing error message that might lead people to think the packaging failed (see mosra/magnum-plugins#105) - Updated Emscripten toolchains to not pass
-s WASM
to the compiler, as only the linker needs it and recent versions complain loudly (see mosra/toolchains#16) - Updated Emscripten toolchains to set
CMAKE_<LANG>_COMPILER
to the cache so MSVC IntelliSense can work with it (see mosra/toolchains#17) - Corrade/
Utility/ Memory.h now has #include <malloc.h>
on Windows as well instead of declaring aligned memory allocation functions on its own, as it's not worth the seriously-looking compiler warnings (see mosra/corrade#145) - Platforms that support CORRADE_
CPU_ USE_ IFUNC will now build certain code paths optimized for multiple architectures, with the best variant selected at runtime using the Cpu library based on available CPU features. This behavior can be disabled with the CORRADE_ BUILD_ CPU_ RUNTIME_ DISPATCH CMake option. Platforms without IFUNC support implement runtime dispatch using function pointers instead of indirect functions and have this currently disabled by default. - Various warning fixes (see mosra/
corrade#151) - Preventing a build error on Emscripten if
CORRADE_UTILITY_USE_ANSI_COLORS
is passed to CMake (see mosra/corrade#153) - The corrade_
add_ test() CMake macro now recognizes a new CORRADE_TESTSUITE_TEST_TARGET
CMake variable to put tests into a dedicated target instead of building them as part of the implicitALL
target. - Updated Corrade/
Utility/ StlForwardArray.h and Corrade/ Utility/ StlForwardTuple.h to work on libc++ 16 - On Windows there's a new
CORRADE_BUILD_STATIC_UNIQUE_GLOBALS_DLL_NAME
CMake option to aid CORRADE_BUILD_ STATIC_ UNIQUE_ GLOBALS in cases where Corrade is only linked to a DLL but not the main executable. - Worked around a compilation failure on MSVC 2022 with
/fsanitize=address /std:c++17 /permissive-
, where a definition of__sanitizer_annotate_contiguous_container()
in Corrade/Containers/ GrowableArray.h would conflict with MSVC's own in <vector>
that additionally has anoexcept
specifier - Made it possible to optionally find TestSuite via
find_package()
without causing a fatal error if not found on platforms that need additional runner files like XCTest, Android and Emscripten. See also mosra/corrade#170. - It's now possible to build dynamic libraries on Android and Emscripten with the usual options. Static libraries are still a default but it isn't enforced anymore. See mosra/
corrade#170. - Fixed a build error related to the
environ
variable on macOS versions before 10.8. See mosra/corrade#175. - The Emscripten toolchain now prefers include directory located in the Emscripten cache, which as of Emscripten 3.0.4 contains the
version.h
header. See mosra/corrade#133. - The Emscripten toolchain now uses the
-flto
flag instead of--llvm-lto
, which was specific to the fastcomp backend that's removed as of Emscripten 2.0, and sets up correctemar
to be used for LTO. See mosra/toolchains#13, mosra/ toolchains#14 and mosra/ magnum#490. - The Emscripten build now uses
--js-library
instead of inlineEM_ASM()
for calling into JavaScript. This allows it to properly specify its runtime dependencies without risking breakages when new Emscripten versions make more JS API functions optional, and circumvents the need for users to specify-s EXPORTED_FUNCTIONS
on their side. - Utility::
Path:: copy() now uses an 8 kB buffer instead of 128 kB to not crash on Emscripten 3.1.27+, which reduced the default stack size from 5 MB to 64 kB. - New
#pragma ACME forget
option in the Single-header generator tool utility /OPT:NOICF
is now added for the Interconnect library for clang-cl as well (see mosra/corrade#178) - The Emscripten toolchain no longer uses a
*.bc
extension for static libraries, as that breaks builds with version 3.1.52+. See mosra/magnum#633 for more information. - Fixed most remaining warnings on MSVC, in particular those related to "conversion from T to void * of greater size". See also mosra/
magnum#544. - Fixed ambiguity with std::
format() when compiling Corrade as C++20 on certain STL implementations (see mosra/ corrade#184) - The
corrade_add_test()
CMake command is fixed to not call Node.js with itself whenCMAKE_CROSSCOMPILING_EMULATOR
is set (see mosra/corrade#185) - Corrade can now cross-compile and use its own corrade-rc executable through an emulator if
CMAKE_CROSSCOMPILING_EMULATOR
is set, instead of requiring a native version of it to be compiled first. See also mosra/corrade#81 and mosra/ corrade#185. - Corrade now automatically installs and uses Find modules for its dependencies in a way that doesn't clash with modules of the same name potentially installed by other software, meaning the user doesn't need to copy and carry them along anymore (see mosra/
magnum#436)
Bug fixes
- Containers::
arrayReserve() was not correctly propagating an explicit allocator argument when checking for capacity, using always the implicit one, and thus resulting in unnecessary reallocation in some cases Containers:: arrayAppend(Array<T>&, std:: initializer_list<typename std:: common_type<T>:: type>) was not correctly propagating an explicit allocator argument, causing the array to be always reallocated using the implicit one - Utility::
Path:: libraryLocation() documentation now mentions caveats related to position-independent code on Unix platforms and the corresponding test was fixed to ensure the preconditions are met. See also mosra/ corrade#135. - Utility::
Path:: list() was leaking the file handle on Windows (see mosra/ corrade#99) - Fixed Utility::
Path:: move() to overwrite the destination if it exists also on Windows, consistently with other platforms (see mosra/ corrade#143) - Fixed Utility::
Path:: homeDirectory() and configurationDirectory() to not use an old Windows API that tends to prefer OneDrive over local user directories (see mosra/ corrade#144) - Added GCC 4.8-specific workarounds to Containers::
Array, growable array utils, Containers:: Optional, Containers:: Pointer and Containers:: StaticArray where using T{b}
orT{std::move(b)}
to perform copy/move-construction on a plainstruct
would cause GCC 4.8 to attempt to construct the members directly instead of invoking a copy/move-constructor, using()
instead works. - When crosscompiling with Corrade as a CMake subproject and not using
find_package()
,corrade_add_resource()
failed late during build on theCorrade::rc
target not being defined (see mosra/corrade#101) - On Emscripten, Utility::
Arguments used an internal allocation function, which changed signature in 2.0.5 and caused runtime failures when -s ASSERTIONS
was enabled. A public stable API is now used instead, see mosra/corrade#106. - Containers::
Array growable utilities, Containers:: String, Utility:: copy(), Utility:: format() and Utility:: Sha1 was fixed to not call std:: memcpy() with nullptr
when size is zero (see mosra/corrade#102) - Fixed Utility::
Arguments to produce an error instead of asserting in case a positional argument is specified as named - Deep Utility::
ConfigurationGroup assignments didn't properly reassign the configuration() pointer, leading to an assertion on save - Corrade/
Utility/ StlForwardTuple.h was fixed to do a full #include <tuple>
on libstdc++ before version 7 as there a forward declaration is not available - Utility::
Tweakable was not correctly parsing unsigned long long
literals, truncating them to 32 bits - Tests ran using CTest under Emscripten used to have
--stack-trace-limit=0
set, preventing Node.js from printing a backtrace on exception. This was originally needed because historically Emscripten applications didn't correctly propagatemain()
return codes, which had to be worked around by throwing an exception instead. This workaround became obsolete and got removed in 2017, but this option was left there by accident. Now it's removed as well. - PluginManager::
Manager no longer dies on startup on an internal assertion if duplicate static plugins are encountered. This can happen when a static plugin is linked to multiple dynamic libraries or modules which then get used in a single executable. - Calling PluginManager::
AbstractManager:: setPreferredPlugins() with a plugin of given alias being instantiated led to an internal assertion when the plugin got later unloaded. - Fixed PluginManager::
AbstractManager:: load() and loadAndInstantiate() to properly interpret non-absolute plugin filenames as relative to current working directory instead of passing them directly to OS APIs, which then attempt to load them from OS-specific locations and fail - TestSuite::
Compare:: SortedContainer no longer modifies order of referenced elements when non-owning views are passed to it - Fixed the CORRADE_
CONSTEXPR14 macro be empty on MSVC 2015, which doesn't support C++14 relaxed constexpr rules yet. See also mosra/ corrade#152. - Fixed the
corrade_add_resource()
CMake macro to properly trim trailing whitespace before looking for files for dependency tracking. - Adapted a Containers::
ArrayView and Containers:: StaticArrayView test related to constexpr
usage to expect a strange failure on Clang 14 with AddressSanitizer enabled. Fixed again in Clang 15, although no related bug report or commit was found. See also mosra/corrade#135. - Fixed the library to build and pass tests when CORRADE_
NO_ ASSERT or CORRADE_ STANDARD_ ASSERT is defined. - Fixed three more cases of a "chosen constructor is explicit in
copy-initialization" C++ featurebug when using growable Containers::
Array APIs and Containers:: StaticArray with a struct that has a member with an explicit default constructor.
Deprecated APIs
- All CMake build options are now prefixed with
CORRADE_
. For backwards compatibility, unless CORRADE_BUILD_ DEPRECATED is disabled and unless a prefixed option is already set during the initial run, the unprefixed options are still recognized with a warning. In particular, if BUILD_DEPRECATED
is set butCORRADE_BUILD_DEPRECATED
not, the unprefixed options are also recognized. See also mosra/corrade#139. Containers::Array::empty()
,ArrayView::empty()
,StaticArray::empty()
,StaticArrayView::empty()
andStridedArrayView::empty()
is deprecated in favor of Containers::Array:: isEmpty, ArrayView:: isEmpty(), StaticArray:: isEmpty(), StaticArrayView:: isEmpty() and StridedArrayView:: isEmpty(). The original name was chosen only to match what STL did, but it could be confused with "make the array empty" (i.e., what clear()
does) and it was inconsistent with all other APIs returning abool
as well as the new Containers::String and StringView APIs, which all use isSomething()
instead.- Containers::
Array, ArrayView, StaticArray, StaticArrayView and StridedArrayView slicing APIs were reworked for more consistency. In particular: except()
is deprecated in favor of exceptSuffix(), being consistent with the new Containers::StringView:: exceptSuffix(StringView) const API suffix()
is deprecated in favor of exceptPrefix(), being consistent with the new Containers::StringView:: exceptPrefix(StringView) const API, as both take a prefix length, and not suffix length. The suffix()
API, taking a suffix length instead of an offset, is scheduled to be reintroduced once enough time passes after the deprecated API gets removed to avoid silent breakages in existing code.
Size
andStride
typedefs in Containers::StridedArrayView are deprecated in favor of Size, Size1D, Size2D, Size3D, Size4D, Stride, Stride1D, Stride2D, Stride3D and Stride4D aliases living directly in the Containers namespace, as those are significantly shorter to type Utility::Directory::isSandboxed()
is deprecated in favor of Utility::System:: isSandboxed(), as that's the better place for this API to live in - All other
Utility::Directory
APIs are deprecated in favor of a new Utility::Path namespace. It uses the more efficient Containers:: StringView instead of std:: string for function arguments and non-owned return values, Containers:: String instead of std:: string for owned return values, wraps return values for all failable APIs in a Containers:: Optional and makes various API naming cleanups and clarifications. Because of the sweeping nature of the changes, it was not possible to make these updates in Utility::Directory
directly, as it would cause basically all existing code to break. Thus the new APIs are in a completely new namespace:Utility::Directory::fromNativeSeparators()
andtoNativeSeparators()
is deprecated in favor of Utility::Path:: fromNativeSeparators() and toNativeSeparators() Utility::Directory::path()
andfilename()
is deprecated in favor of Utility::Path:: split() that returns both parts together Utility::Directory::splitExtension()
is deprecated in favor of Utility::Path:: splitExtension() Utility::Directory::join()
is deprecated in favor of Utility::Path:: join() Utility::Directory::list()
,Flag
andFlags
are deprecated in favor of Utility::Path:: list(), ListFlag and ListFlags, returning the list wrapped in a Containers:: Optional Utility::Directory::mkpath()
,rm()
andmove()
are deprecated in favor of Utility::Path:: make(), remove() and move() Utility::Directory::current()
,libraryLocation()
,executableLocation()
,home()
,configurationDir()
andtmp()
are deprecated in favor of Utility::Path:: currentDirectory(), libraryLocation(), executableLocation(), homeDirectory(), configurationDirectory() and temporaryDirectory(), all returning the path wrapped in a Containers:: Optional Utility::Directory::exists()
andisDirectory()
is deprecated in favor of Utility::Path:: exists() and isDirectory() Utility::Directory::fileSize()
is deprecated in favor of Utility::Path:: size() Utility::Directory::read()
is deprecated in favor of Utility::Path:: read(), returning a Containers:: Optional Utility::Directory::readString()
is deprecated in favor of Utility::Path:: readString(), returning a Containers:: String in a Containers:: Optional, transferring the memory ownership from a Containers:: Array instead of making a copy Utility::Directory::write()
,writeString()
,append()
andappendString()
are deprecated in favor of Utility::Path:: write() and append(). Because a Containers:: StringView is implicitly convertible to a Containers:: ArrayView<const void>, there's no need for a dedicated string overload anymore. Utility::Directory::copy()
is deprecated in favor of Utility::Path:: copy(), Utility::Directory::map()
,mapRead()
,mapWrite()
andMapDeleter
are deprecated in favor of Utility::Path:: map(), mapRead(), mapWrite() and MapDeleter, returning the mapped array wrapped in an Containers:: Optional
- The Utility::
Resource class was ported to use Containers:: StringView instead of std:: string, Utility::Resource::get()
is deprecated in favor of Utility::Resource:: getString(). The get()
API is scheduled to be reintroduced — with a Containers::ArrayView return type consistent with Utility:: Path:: read() and Utility:: Path:: readString() — once enough time passes after the deprecated API gets removed to avoid silent breakages in existing code. - Utility::
String:: split() and Utility:: String:: splitWithoutEmptyParts() overloads taking Containers:: BasicStringView are deprecated in favor of Containers:: BasicStringView:: split() and Containers:: BasicStringView:: splitWithoutEmptyParts(); the overloads taking std:: string are still kept Utility::String::viewBeginsWith()
andUtility::String::viewEndsWith()
variants of Utility::String:: beginsWith() / Utility:: String:: endsWith() are deprecated in favor of Containers:: BasicStringView:: hasPrefix() and Containers:: BasicStringView:: hasSuffix(); the overloads taking std:: string are still kept CORRADE_ALIGNAS()
andCORRADE_NORETURN
macros are deprecated as they were originally introduced for compatibility with GCC 4.7 and older and aren't needed anymore. Use the standard C++11alignas()
and[[noreturn]]
attributes instead.- The CORRADE_
ASSUME() macro is moved from Corrade/ Utility/ Assert.h to Corrade/ Utility/ Macros.h, as it's a lightweight annotation that doesn't depend on any debug output. If CORRADE_ BUILD_ DEPRECATED is enabled, the Corrade/ Utility/ Assert.h pulls it in for backwards compatibility. - The
CORRADE_UTILITY_DEBUG_HAS_SOURCE_LOCATION
macro, which was closely tied to Utility::Debug, is deprecated in favor of a more general CORRADE_ SOURCE_ LOCATION_ BUILTINS_ SUPPORTED that's defined inside Corrade/ Utility/ TypeTraits.h instead. - The
CORRADE_STD_IS_TRIVIALLY_TRAITS_SUPPORTED
macro is deprecated in favor of CORRADE_NO_ STD_ IS_ TRIVIALLY_ TRAITS, which is defined only if the traits aren't supported, and is moved to Corrade/ Corrade.h. This solves a recurring problem where forgetting to include Corrade/ Utility/ TypeTraits.h led to the traits checks being silently skipped, while forgetting to include with the inverse macro would lead to a non-silent compiler error on GCC 4. Additionally it prepares better for future removal of GCC < 5 support. - The
CORRADE_INCLUDE_INSTALL_PREFIX
CMake variable, needed for installations into older Android NDKs, is obsolete and no longer needed for NDK r19+. It still does what's expected on builds withCORRADE_BUILD_DEPRECATED
enabled, however you'll get a deprecation notice. Since the variable got saved to CMake cache, to get rid of the message, you may need to either recreate your build directory or explicitly delete it from the cache. - The
Corrade/Containers/Tags.h
header,Containers::DefaultInit
,Containers::ValueInit
,Containers::NoInit
,Containers::NoCreate
,Containers::DirectInit
,Containers::InPlaceInit
and related tag types were moved to Corrade/Tags.h and the root Corrade namespace, available as DefaultInit, ValueInit, NoInit, NoCreate, DirectInit, InPlaceInit and related tag types - PluginManager and TestSuite APIs that switched from std::
string to Containers:: StringView or Containers:: String now include Corrade/ Containers/ StringStl.h for compatibility when building with CORRADE_ BUILD_ DEPRECATED enabled. Include this header explicitly in your code if you wish to continue to rely on implicit conversion from a std:: string. - To avoid unconditionally including relatively heavy headers, PluginManager::
Manager now has the template definitions moved into Corrade/ PluginManager/ Manager.hpp. This header is implicitly included from the *.h
for backwards compatibility if CORRADE_BUILD_ DEPRECATED is defined. While nothing changes when using builtin Corrade and Magnum plugin interfaces, for custom interfaces you need to either include this header explicitly or perform an explicit template instantiation as described in Custom plugin interfaces and template definitions.
Potential compatibility breakages, removed APIs
- All includes of Corrade/
Containers/ PointerStl.h that were added in 2019.01 for preserving backwards compatibility after the move from std:: unique_ptr to Containers:: Pointer are now removed. This should have a significant positive effect on compile times of code using especially the PluginManager library. Containers::ScopedExit
, deprecated in 2019.01, is removed, use Containers::ScopeGuard instead - Removed the
CORRADE_CXX_FLAGS
CMake variable, which was deprecated in favor of theCORRADE_USE_PEDANTIC_FLAGS
target property in 2016. - Removed a dependency of
UseCorrade
onUseEmscripten
to allow 3rd party Emscripten toolchains to be used. This may break code that uses theemscripten_embed_file()
CMake function, to fix that either explicitlyinclude(UseEmscripten)
or update thetoolchains
submodule, which now includes the file implicitly. See mosra/corrade#104. - Containers::
Array, StaticArray, ArrayView, StaticArrayView, String and StringView now contain debug assertions for OOB element access, if necessary implementing an operator[]()
instead of relying on implicit pointer conversions. Code that previously inadvertently made out-of-bound access will now assert in debug builds. - Containers::
arrayAllocatorCast() used to be allowed on nullptr
Containers::Array instances regardless of their allocator but attempting to query capacity of such array or do any growable operation on it then resulted in a crash. It's now checked by an assert, which may cause breakages in existing code that attempted to call this API on default-constructed or empty arrays. - Containers::
LinkedList destruction was changed in a way that makes Containers:: LinkedListItem:: list() still accessible in a destructor of Containers:: LinkedListItem subclasses. This behavior didn't make sense and so it's not assumed any existing code relied on it, nevertheless it's a subtle change in behavior that is worth mentioning. - Containers::
Pointer destructor and reset() now contain a static_assert()
that checks for the type being complete. This avoids accidentally callingdelete
on a pointer to an incomplete type, which doesn't call the type destructors properly and can lead to resource leaks. Existing code where this silently happened will now fail to compile and has to be updated as documented in Usage with incomplete types. - Containers::
Pointer conversion from a derived type and emplace() with a derived type now contain a static_assert()
that checks for either the base type having a virtual destructor or the derived type being trivially destructible. If neither of these is true, attempting todelete
through the base pointer would lead to resource leaks as the derived type destructor would never get called. Existing code where this silently happened will now fail to compile and has to be updated. - PluginManager::
AbstractManager:: pluginList(), aliasList() and PluginManager:: PluginMetadata APIs now return Containers:: String, Containers:: StringIterable or Containers:: Array of Containers:: StringView instead of std:: string and std:: vector instances. As the change was done to avoid including a heavy std:: vector, no backwards compatibility is done. - Overrides of PluginManager::
AbstractPlugin:: pluginInterface(), pluginSuffix() and pluginMetadataSuffix() are now expected to return a global Containers:: StringView, i.e. a string view literal, instead of a std:: string. Since a global view has to be explicitly made, no backwards compatibility can be provides - Override of PluginManager::
AbstractPlugin:: pluginSearchPaths() is now expected to return a Containers:: Array of Containers:: String instead of a std:: vector of std:: string, similarly PluginManager:: implicitPluginSearchPaths() is changed to match that. As the change was done to avoid including a heavy std:: vector, no backwards compatibility is done. - Due to changes to CORRADE_
SKIP() internals, passing a std:: string to it now requires an explicit #include <Corrade/Utility/DebugStl.h>
. Alternatively, if string concatenation was used, you can compose the message by chaining Utility::Debug output operators instead. - Utility::
String:: replaceFirst() and Utility:: String:: replaceAll() is now operating on a Containers:: StringView and returns a Containers:: String. The original std:: string overloads had to be removed as they caused various ambiguities, so using these functions with std:: string may now need extra casts. - Utility::
String:: lowercase() and Utility:: String:: uppercase() now has overloads for both Containers:: StringView and std:: string, which may cause ambiguous overload errors for existing code that passes const char*
to it. Given that either type is valid now, the code has to be updated to explicitly pass that type to the function. - Utility::
format() now returns a Containers:: String instead of Containers:: Array and Utility:: formatInto() now takes a Containers:: MutableStringView instead of Containers:: ArrayView. The types are however implicitly convertible and thus breakages are not expected in majority of existing code. - Printing a C++17 std::
string_view with Utility:: Debug now requires the Corrade/ Utility/ DebugStlStringView.h include. Before it was printed as a numeric container due to Utility:: IsStringLike not recognizing it. Utility::Resource::compile()
andUtility::Resource::compileFrom()
APIs are no longer public, but rather a private detail of the corrade-rc utility.Utility::Resource::list()
now returns a Containers::StringIterable instead of a std:: vector of std:: string. Because the reason for this change was to get rid of #include <vector>
, no backwards compatibility is provided.- As part of the ongoing STL usage cleanup, Utility::
TweakableParser is now expected to return a Containers:: Pair instead of std:: pair - As part of the ongoing STL usage cleanup, the Utility::
Unicode namespace now uses Containers:: Pair and Containers:: StringView, all uses of std:: pair and std:: string were removed. The Utility:: Unicode:: utf32() API now returns a Containers:: Array<char32_t> wrapped in a Containers:: Optional. Utility:: Unicode:: narrow() and widen() variants taking a view or a char pointer now return either a Containers:: String or a Containers:: Array<wchar_t> instead of std:: string or std:: wstring. Corrade/ Containers/ PairStl.h is included for implicit conversions to a std:: pair and Corrade/ Containers/ StringStl.h is included for implicit conversions from/to a std:: string, but there's no implicit conversion for std:: wstring or std:: u32string.
Documentation
- Added a table mapping between STL and Corrade containers
- New and thorough documentation for the Utility::
Resource class - Various fixes (see mosra/
corrade#108, mosra/ corrade#119, mosra/ corrade#120, mosra/ magnum#600, mosra/ corrade#161)
2020.06
Released 2020-06-27, tagged as v2020.06.
New features
- Clang-CL is now a supported compiler on Windows. See also mosra/
corrade#40. - New CORRADE_
TARGET_ GCC, CORRADE_ TARGET_ CLANG, CORRADE_ TARGET_ APPLE_ CLANG, CORRADE_ TARGET_ CLANG_ CL, CORRADE_ TARGET_ MSVC and CORRADE_ TARGET_ MINGW variables for easier compiler identification - New CORRADE_
TARGET_ SSE2 providing an extremely minimal SIMD feature detection. More extensions to come later. - New CORRADE_
TARGET_ BIG_ ENDIAN macro. A variant of this macro called just CORRADE_BIG_ENDIAN
was used internally for a long time, now it's been exposed publicly. - New CORRADE_
CONSTEXPR14 macro for marking constexpr
functions that make use of C++14 relaxed constexpr rules but still need to work under C++11 as well.
Containers library
- New Containers::
arrayAppend(), Containers:: arrayReserve() family of functions for opt-in growable arrays. See Growable arrays and mosra/ corrade#83 for more information. - Added Containers::
arrayCast() overloads for casting from the Containers:: ArrayView<void> and Containers:: ArrayView<const void> specializations - New Containers::
StridedArrayView<dimensions, void> and Containers:: StridedArrayView<dimensions, const void> together with corresponding Containers:: arrayCast() overloads for type-erased constexpr
enabled passing of strided array views similarly to the existing Containers::ArrayView<void> and Containers:: ArrayView<const void> types - New Containers::
stridedArrayView() convenience overload taking explicit stride and size parameters - New Containers::
array(std:: initializer_list<T>), Containers:: arrayView(std:: initializer_list<T>) and Containers:: stridedArrayView(std:: initializer_list<T>) helpers for turning initializer lists into (strided) array(view)s. These are deliberately not present as constructors as there would be various caveats with such approach. - Added Containers::
StridedArrayView:: isContiguous() and asContiguous() for checking and conversion to a tightly packed view - New Containers::
enumCastUnderlyingType() utility functions for casting an enum
or Containers::EnumSet to its underlying type
PluginManager library
- Added PluginManager::
implicitPluginSearchPaths() for a well-documented and reliable way to supply plugin search paths consistent for all for plugin interfaces - Ability to override plugin binary and metadata file extensions on a per-interface basis using PluginManager::
AbstractPlugin:: pluginSuffix() and PluginManager:: AbstractPlugin:: pluginMetadataSuffix()
TestSuite library
- New CORRADE_
ITERATION() macro for annotating loops - Added TestSuite::
Compare:: Divisible and TestSuite:: Compare:: NotDivisible pseudo-types for checking divisibility with clear diagnostic messages
Utility library
- Added Utility::
Arguments:: setParseErrorCallback() for implementing additional argument parsing logic and overriding the default behavior - Added Utility::
Arguments:: addArrayOption() for an ability to supply a sequence of values to the same option - Ability to optionally prefix Utility::
Debug output with a source file and line on supported compilers. See Source location and mosra/ corrade#55 for more information. - New CORRADE_
ASSUME() macro for providing hints to the compiler similarly to CORRADE_ INTERNAL_ ASSERT() but without asserting when the condition isn't true
- New CORRADE_
FALLTHROUGH macro for suppressing warnings on fall-through switch
cases - Added a
CORRADE_STD_IS_TRIVIALLY_TRAITS_SUPPORTED
macro into Corrade/Utility/ TypeTraits.h denoting if std:: is_trivially_copyable is available in the standard library - Added a CORRADE_
LONG_ DOUBLE_ SAME_ AS_ DOUBLE macro for detecting platforms where long double
anddouble
have the same size - Added
Utility::Directory::map(const std::string&)
that provides read-write access to mapped files without truncating them. - Added
Utility::Directory::fileSize()
- New Utility::
Endianness:: littleEndianInPlace() and Utility:: Endianness:: bigEndianInPlace() overloads taking strided array views - Exposed Utility::
Endianness:: swapInPlace() as a counterpart to Utility:: Endianness:: littleEndianInPlace() and Utility:: Endianness:: bigEndianInPlace() - New family of Utility::
copy() functions to efficiently copy multi-dimensional Containers:: StridedArrayView instances - Added a Utility::
Debug:: space modifier that's similar to Utility:: Debug:: newline and an inverse of Utility:: Debug:: nospace - Added a Utility::
Endianness:: fourCC() utility for creating endian-independent four-character codes
Changes and improvements
- TestSuite::
Tester and the CORRADE_ INTERNAL_ ASSERT() family of macros now prints file/line info in test failures as a more compact <file>:<line>
, which is consistent with Utility::Debug source location and how GCC or GDB print those - Added an ability to disable unique globals across shared libraries using CORRADE_
BUILD_ STATIC_ UNIQUE_ GLOBALS on static builds that don't need it - Library version is now exposed through
CORRADE_VERSION_YEAR
,CORRADE_VERSION_MONTH
,CORRADE_VERSION_COMMIT
,CORRADE_VERSION_HASH
andCORRADE_VERSION_STRING
preprocessor defines in a newCorrade/version.h
header. This header is not included by any other header to avoid trigerring a full rebuild when Git commit changes. If Git is not found, only the first two defines are present.
Containers library
- Containers::
Array:: Array(NoInitT, std:: size_t) is now equivalent to Containers:: Array:: Array(DefaultInitT, std:: size_t) for trivial types. This is done in order to avoid needless problems with dangling custom deleters when returning arrays from dynamically loaded libraries. - Containers::
ArrayView compatibility with std:: span was updated to work with libc++ 9 (and upcoming implementations in GCC and elsewhere), as it no longer uses std:: ptrdiff_t as a size. - Containers::
Array move constructor and Containers:: Array:: release() now reset the deleter of the originating array to nullptr
to avoid false assumptions about moved-from instances or calling unsuspecting deleters on null pointers - The dimension-changing Containers::
arrayCast(const StridedArrayView<dimensions, T>&) utility has a new overload accepting Containers:: ArrayView as well, and got extended to support reinterpreting the last contiguous dimension into a different type - In-place element construction in Containers::
Array, Containers:: StaticArray, Containers:: Pointer, Containers:: Optional and growable array utilities now properly handle a case of default-constructing a struct
that contains members with explicit default constructors. Previously such cases caused achosen constructor is explicit in copy-initialization
compiler error on Clang and a rarer but similar one in case of GCC as well.
Interconnect library
- Interconnect::
connect() now can recognize trivially copyable lambdas also on GCC versions before 5 and store them more efficiently
PluginManager library
- Internals of PluginManager::
Manager were rewritten to not need any shared global state. This was only needed for inter-manager dependencies, which is only very rarely used by Magnum. This feature is now rewritten to not need any global state, instead the user is expected to connect manager instances together using PluginManager:: AbstractManager:: registerExternalManager().
TestSuite library
- The CORRADE_
VERIFY(), CORRADE_ COMPARE(), CORRADE_ BENCHMARK() and other macros can now be called also from inside lambdas and helper functions, not just directly from a TestSuite:: Tester subclass - Floating-point fuzzy compare epsilons were updated to be consistent with Utility::
Debug and Utility:: format() precision as well as what Magnum used. In particular, the epsilons are now 1.0e-5f
,1.0e-14
and1.0e-17l
instead of1.0e-6f
,1.0e-12
and1.0e-15l
- To avoid aborting the whole test on unhandled exceptions, TestSuite::
Tester now catches exceptions derived from std:: exception. See Catching exceptions for more information.
Utility library
- CORRADE_
ASSERT(), CORRADE_ CONSTEXPR_ ASSERT() and CORRADE_ ASSERT_ OUTPUT() now only return if CORRADE_ GRACEFUL_ ASSERT is defined and Utility:: Error is redirected, otherwise they call std:: abort() like if CORRADE_ GRACEFUL_ ASSERT wouldn't be defined. This makes it possible to both verify assertion behavior and catch unexpected assertions in tests that enable graceful assertions for larger pieces of code. - CORRADE_
ASSERT_ UNREACHABLE() now accepts a message, acting as a better alternative to CORRADE_ASSERT(false, ...)
; the original functionality is provided by CORRADE_INTERNAL_ ASSERT_ UNREACHABLE() - CORRADE_
DEPRECATED_ NAMESPACE() now works on GCC 10 as well - Utility::
Sha1 can now consume also Containers:: ArrayView in addition to std:: string and its internal processing is completely allocation-less (see mosra/ corrade#85) - CORRADE_
HAS_ TYPE() now allows usage of template expressions containing commas - Enabled Utility::
Debug:: operator<<(long double) on Emscripten as well, as it being unavailable was a pointless restriction hurting portability Utility::Directory::mkpath()
now properly reports errors instead of just arrogantly returningfalse
(see mosra/corrade#92)
Build system
- Fixed compilation of the Corrade::
Main library on i686 MinGW UseCorrade.cmake
definedNOMINMAX
andWIN32_LEAN_AND_MEAN
by mistake only on MSVC, causingwindows.h
to leak unforgivable crimes when compiling under MinGW (see mosra/magnum-plugins#74) - Fixed MSVC detection in
conanfile.py
, made it aware of theMSVC2019_COMPATIBILITY
option as well (see mosra/corrade#93) - The library again compiles and tests cleanly with CORRADE_
NO_ ASSERT enabled, and this setup is verified on the CI to avoid further regressions - Fixes to make the library work under MinGW Clang (see mosra/
corrade#95) - Fixed compilation on GCC 10 (see mosra/
corrade#97) UseAndroid.cmake
no longer expectsadb
to be in$PATH
, but it locates it relatively to Android SDK (see mosra/toolchains#10) - Various warning fixes (see mosra/
corrade#96)
Bug fixes
- The CORRADE_
TARGET_ LIBSTDCXX macro was defined on GCC < 5 only when certain headers were included before. That caused problems especially with the new CORRADE_STD_IS_TRIVIALLY_TRAITS_SUPPORTED
macro and is now fixed to assume old GCC versions always use libstdc++. - Fixed an assertion in Utility::
Arguments when a single -
was passed on the command-line - Utility::
Endianness:: swapInPlace() and other in-place APIs were fixed to work correctly on platforms that don't allow unaligned reads and writes - Utility::
ConfigurationValue was saving double
andlong double
with only 6 precision digits due to silly std::ostream defaults. Now it prints those with 15 and 18 digits respectively, consistent with Utility:: Debug and Utility:: format() output - As internals of PluginManager::
Manager were rewritten to not need any shared global state anymore, various corner cases and crashes on destruction are not happening anymore. In particular, it's now also possible to have two instances of the same manager type without the two interfering with each other in any way.
Documentation
- Various fixes and clarifications (see mosra/
corrade#80, mosra/ magnum#418)
Deprecated APIs
Utility::Directory::map(const std::string&, std::size_t)
is deprecated and renamed toUtility::Directory::mapWrite()
as it doesn't preserve original file contents and thus can't be used for read-write access- The internal
CORRADE_BIG_ENDIAN
macro got renamed to CORRADE_TARGET_ BIG_ ENDIAN and made public. The old variant is still present for backwards compatibility, but will be removed in the future.
Potential compatibility breakages, removed APIs
- CORRADE_
ASSERT_ UNREACHABLE() now accepts a message and will fail to compile when used with an empty argument list. The original functionality is provided by CORRADE_ INTERNAL_ ASSERT_ UNREACHABLE() instead. - Containers::
Array and Containers:: StaticArray was switched to do the Containers::ValueInit
construction by default instead ofContainers::DefaultInit
, i.e. zero-initializing trivial types instead of keeping them uninitialized. Apart from introducing potential slowdowns due to the additional zero-ininitialization this isn't really breaking, just makes the default safer; and you still have the option to choose a different initialization. - Utility::
Debug and Utility:: format() now prints long double
with 15 significant digits instead of 18 on platforms where it is 64-bit instead of 80-bit - Utility::
Endianness is now a namespace, similarly to the change done to Utility::Directory
or Utility::String in 2018.02. The API doesn't change apart from that, but code previously doing using Utility::Endianness
needs to be changed tousing namespace Utility::Endianness
to compile again. - Removed
Corrade/Utility/AndroidStreamBuffer.h
that was deprecated in 2018.04, use Corrade/Utility/ AndroidLogStreamBuffer.h instead - Removed
PluginManager::Manager::instance()
that was deprecated in 2018.04, use PluginManager::Manager:: instantiate() instead
2019.10
Released 2019-10-24, tagged as v2019.10.
Dependency changes
- Minimal supported CMake version is now 3.4. Older versions are not supported anymore and all workarounds for them were removed. Download a prebuilt release of a newer version if you need to use Corrade on older systems (such as Ubuntu 14.04 or Debian 8). This is a conservative change that shouldn't affect any additional distribution compared to the CMake 3.1 requirement in 2019.01.
New features
- MSVC 2019 support. It needs about the same set of workarounds as MSVC 2017, which means there's a new (automatically enabled)
MSVC2019_COMPATIBILITY
CMake option, exposed further asCORRADE_MSVC2019_COMPATIBILITY
CMake variable and preprocessor macro. See also mosra/magnum-bootstrap#18 and mosra/ magnum#343. - New Corrade::
Main library for improved user experience and consistent behavior on Windows platforms (see mosra/ corrade#37 and mosra/ magnum#98) - When using Corrade as a CMake subproject, it now puts all binaries into a common directory to simplify
PATH
handling and dynamic plugin loading. For more information see Using Corrade as a CMake subproject, mosra/magnum#357 and mosra/ magnum-plugins#63. - Added CORRADE_
TARGET_ POWERPC for detecting PowerPC architectures (see mosra/ corrade#60) - New set of CORRADE_
TARGET_ LIBCXX, CORRADE_ TARGET_ LIBSTDCXX and CORRADE_ TARGET_ DINKUMWARE macros to detect the common STL implementations - New CORRADE_
BUILD_ MULTITHREADED build-time option, moved from Magnum
Containers library
- The Containers::
ArrayView, Containers:: StaticArrayView, Containers:: StridedArrayView, Containers:: Array and Containers:: StaticArray classes are now available as single-header libraries for easier integration into your projects. See Single-header libraries for more information. - Opt-in STL compatibility for Containers::
ArrayView, Containers:: StaticArrayView and Containers:: StridedArrayView classes, allowing them to be implicitly converted from std:: vector and std:: array (see also mosra/ corrade#75) - Opt-in STL compatibility for Containers::
Array, Containers:: ArrayView, Containers:: StaticArray, Containers:: StaticArrayView and Containers:: StridedArrayView allowing them to be implicitly converted to/from C++2a std:: span - Containers::
StridedArrayView is now multi-dimensional with a possibility of negative and zero strides, making it usable in a broader range of use-cases - Added convenience make functions, similar to existing Containers::
arrayView() and Containers:: staticArrayView() - Added compile-time-sized Containers::
StaticArrayView:: suffix() and Containers:: StaticArray:: suffix() variants - Added Containers::
ArrayView:: slice() const, Containers:: StaticArrayView:: slice() const, Containers:: Array:: slice() const and Containers:: StaticArray:: slice() const variants that take both being and end offsets at compile time (and thus also more range checking at compile time) - Added
Containers::ArrayView::except()
and similar APIs to Containers::StaticArrayView, Containers:: Array, Containers:: StaticArray and Containers:: StridedArrayView. It's like Containers:: ArrayView:: prefix() but taking a count of items to exclude from the end instead of how much to include from the beginning. - Added a Containers::
ArrayView<void> specialization as a mutable type-erased counterpart to Containers:: ArrayView<const void>
PluginManager library
- Added a CORRADE_
PLUGIN_ EJECT() macro doing an inverse of CORRADE_ PLUGIN_ IMPORT() for static plugins, useful mainly for testing purposes
TestSuite library
- Custom TestSuite comparators can now optionally save diagnostic files as well as print formatted messages to the output. See Saving diagnostic files for more information.
- Added TestSuite::
Tester:: setTestCaseTemplateName() for convenient distinction of different specializations of templated test cases - TestSuite::
Tester now warns when dynamic CPU scaling is used on Linux and benchmarks are being run, as that makes the measurements rather noisy. With the --verbose
command-line option it prints further information.
Utility library
- Utility::
Debug:: packed and Utility:: Debug:: color output modifiers for tighter printing of container types and printing color-like values as actual 24bit ANSI color sequences - New
Utility::Directory::append()
andUtility::Directory::appendString()
counterparts toUtility::Directory::write()
- New
Utility::Directory::copy()
utility for zero-allocation file copies. - New
Utility::Directory::join(std::initializer_list<std::string>)
overload for joining a path from multiple parts at once - New
Utility::Directory::current()
utility for getting current working directory - New
Utility::Directory::isDirectory()
utility for distinguishing between files and directories Utility::Directory::libraryLocation()
as a counterpart toUtility::Directory::executableLocation()
Utility::Directory::splitExtension()
as a complement toUtility::Directory::path()
andUtility::Directory::filename()
- New Corrade/
Utility/ StlForwardArray.h, Corrade/ Utility/ StlForwardString.h, Corrade/ Utility/ StlForwardTuple.h and Corrade/ Utility/ StlForwardVector.h headers providing lightweight forward declarations for std:: array, std:: string, std:: tuple and std:: vector on platforms that have them (and including the full definition otherwise). These are also available as single-header libraries for easier integration into your projects. See Single-header libraries for more information. - New Corrade/
Utility/ StlMath.h header providing bloat-free #include <cmath>
on C++17 an up. This header is also available as a single-header library for easier integration into your projects. See Single-header libraries for more information. - New Utility::
IsStringLike type trait - Added Utility::
format(), an alternative to Utility:: formatString() returning Containers:: Array instead of std:: string - Utility::
Debug scoped output redirection and coloring is now done thread-local by default (see mosra/ corrade#66) - Added Utility::
Debug:: defaultOutput(), Utility:: Warning:: defaultOutput() and Utility:: Error:: defaultOutput() for easy redirection back to the default output - Utility::
Arguments is now able to ignore unknown options in the prefixed variant - Added Utility::
Arguments:: addFinalOptionalArgument(), combining the best of arguments and options together in one wonderful feature - Utility::
FileWatcher learned to optionally ignore stat errors (for example if the file is missing) and to optionally not signal a change if the file is empty; Utility:: Tweakable is using these features for more robustness - Added Utility::
String:: partition() and rpartition(), equivalent to Python's str.partition()
- New CORRADE_
FUNCTION utility macro for a portable C++11 __func__
- New CORRADE_
LINE_ STRING utility macro for a stringified __LINE__
- New CORRADE_
THREAD_ LOCAL macro for a portable thread_local
annotation - New CORRADE_
ALWAYS_ INLINE and CORRADE_ NEVER_ INLINE annotations for easier overriding of optimizer behavior - New CORRADE_
VISIBILITY_ INLINE_ MEMBER_ EXPORT visibility macro to aid codebases compiled with -fvisibility-inlines-hidden
; the CORRADE_VISIBILITY_ EXPORT and friends are now also properly documented - Added a CORRADE_
NOOP() macro for a portable way to define out function macros on compiler command line.
Changes and improvements
- Global state used by PluginManager::
Manager, Utility:: Debug and Utility:: Resource internals is no longer duplicated when Corrade is built statically and linked to more than one dynamic library or executable. This works on all platforms except for Python bindings on Windows at the moment, where the workaround is to build Corrade dynamically. - PluginManager::
Manager and Utility:: Debug now have the global state thread-local when the CORRADE_ BUILD_ MULTITHREADED option is enabled (see also mosra/ corrade#65)
Containers library
- It's now possible to create Containers::
ScopeGuard without a handle in order to easily call a global function or lambda on scope end - Implicit memory management of Containers::
LinkedList can be now overridden by reimplementing Containers:: LinkedListItem:: erase() - The CORRADE_
ENUMSET_ FRIEND_ OPERATORS() macro now works with templated classes and doesn't need a corresponding CORRADE_ ENUMSET_ OPERATORS() to be present anymore - Containers::
StaticArray is now copyable and movable if the underlying type is copyable / movable as well, to make it useful in more use cases. Note that currently, same as with Containers:: Optional, std:: is_copy_constructible etc. don't properly report false
for non-copyable / non-movable types. That'll get fixed in a future release.
Interconnect library
- The Interconnect library internals got reworked with less allocations, better memory usage, improved signal emitting performance and support for connecting to arbitrary function objects along with std::
function. See also mosra/ corrade#63 for more information.
PluginManager library
- Instantiating a PluginManager::
Manager without an explicit plugin directory will only print a warning about no dynamic plugins found if there's no statically linked plugin either. That makes it behave better on setups where all plugins are always linked statically. - PluginManager::
Manager now explicitly checks for presence of a plugin metadata file for dynamic plugins and fails with PluginManager:: LoadState:: WrongMetadataFile if it's not found. Previously it was silently ignoring missing metadata files, often resulting in a runtime linker error due to a dependency not being loaded. - CORRADE_
PLUGIN_ REGISTER() now operates completely without heap access, making it safe to run in restricted phases of application execution - PluginManager::
AbstractPlugin now implements a destructive move constructor
TestSuite library
- When a test executed through CTest fails on Android, the uploaded test executable is kept in
/data/local/tmp
so it's possible to debug it manually later. See the Android testing docs for more information. - Android tests ran through CTest have stderr redirected to stdout because otherwise the
adb
bridge causes them to be extremely out-of-sync - TestSuite::
Tester:: testCaseId(), TestSuite:: Tester:: testCaseInstanceId() and TestSuite:: Tester:: testCaseRepeatId() are now expected to be called only from within actual (instanced, repeated) test cases instead of silently giving back an undefined value, making mistakes harder to spot
Utility library
- Assertion messages now ignore Utility::
Error output redirection to ensure the application never aborts without a message - Utility::
Debug output behavior can be now configured using new Utility:: Debug:: setFlags() and Utility:: Debug:: setImmediateFlags() in addition to output modifiers such as Utility:: Debug:: nospace - Utility::
Debug prints nested containers separated with a newline for more readable output - CORRADE_
ASSERT_ UNREACHABLE() now compiles into a compiler builtin on MSVC as well - Utility::
format() now prints enum
values implicitly convertible to integers as integers without requiring the user to do an explicit cast first - Utility::
Configuration internals were rewritten to not use exceptions anymore - The CORRADE_
AUTOMATIC_ INITIALIZER() and CORRADE_ AUTOMATIC_ FINALIZER() macros can now be overridden for testing purposes or when global constructors / destructors are not desired. - Utility::
Resource internals now operate completely without heap access, its APIs now also have overloads taking plain C string literals instead of std:: string - Utility::
String:: join() and Utility:: String:: joinWithoutEmptyParts() overloads taking a char
array and a std::string for the delimiter in addition to a single char
Build system
- MSYS2 packages are now in official repositories, installable directly via
pacman
- The CORRADE_
CXX_ STANDARD preprocessor macro learned support for the upcoming C++2a standard. The equivalent CMake property can now be set to 20
to pass the-std=c++2a
flag to GCC and Clang and/std:c++latest
to MSVC. - It's now possible to use the TestSuite library via CMake subprojects also on Android, iOS and Emscripten
- Explicitly disabling a MSVC linker optimization that causes seemingly similar signals to be conflated together, causing erratic behavior. This is done automatically for CMake-based projects, see the Interconnect::
Emitter documentation for more information when using custom buildsystems, see also mosra/ corrade#51. - Fixed compilation with Clang and
-std=gnu++14
(see mosra/corrade#62) - CORRADE_
VISIBILITY_ STATIC no longer exports symbols in static libraries to be consistent with hidden visibility by default, additionally -fvisibility-inlines-hidden
is passed along with-fvisibility=hidden
when CORRADE_USE_ PEDANTIC_ FLAGS property is enabled in CMake on GCC and Clang to avoid linker warnings on macOS (see mosra/ corrade#53) - The Emscripten CMake toolchain now sets the
EMSCRIPTEN
variable to help 3rd party projects (see mosra/toolchains#7) - The Emscripten CMake toolchain now looks for
emcc
on$PATH
as a last resort and then uses the parent directory asEMSCRIPTEN_PREFIX
(see mosra/toolchains#8) - On Windows, if the Emscripten toolchain detects Visual Studio being used as a generator, it'll fail with an error suggesting to use a different generator instead. Previously, CMake silently fell back to using Visual Studio as a C++ compiler, resulting in seemingly impossible errors. See mosra/
corrade#78. - Clarified interaction of
-fvisibility-inlines-hidden
and/or-Wl,-Bsymbolic-functions
GCC/Clang flags and Interconnect::Emitter - The TestSuite library and all tests created with corrade_
add_ test() are now built with -s DISABLE_EXCEPTION_CATCHING=0
being explicitly specified both for the compiler and linker to work correctly on Emscripten 1.38.36 and newer - Emscripten builds now have the
-fPIC
option disabled by default as it causes linker errors related to__memory_base
on 1.38.36 (see also emscripten-core/emscripten#8761) - Fixed dynamic plugin metadata location when
CMAKE_LIBRARY_OUTPUT_DIRECTORY
is set (see mosra/corrade#74) - With CMake 3.15 there's an unfortunate collision between
CORRADE_CXX_STANDARD
and CMake's ownCOMPILE_FEATURES
target property, where a request to use C++14 from a 3rd party library would get ignored with C++11 being used instead. To fix that, theCORRADE_CXX_STANDARD
property does nothing if theCOMPILE_FEATURES
property is set on the target as well. See Using Corrade with CMake for more information. - Fixed corrade_
add_ test() when library output path is set in CMake (see mosra/ corrade#77) - Plugin metadata are now copied next to the binary as a post-build command instead of only during a full build
- Updated the iOS toolchain to make
find_package(Threads)
work correctly
Bug fixes
- The TestSuite::
Comparator class by mistake did not have fuzzy comparison for long double
- Fixed TestSuite::
Compare:: around() for types that don't have a total ordering (for example, for Magnum matrix and vector types, !(a < b)
might not necessarily imply thata >= b
). - Fixed build on big-endian platforms (see mosra/
corrade#58) - Fixed Utility::
Sha1 calculation on big-endian platforms (see mosra/ corrade#60) - Fixed
Utility::Directory::read()
to not useftello()
on 32-bit Android and API levels below 24 - Fixed
Utility::Directory::read()
to work with files that report an early EOF (such as stuff from/sys
on Linux) - Fixed Interconnect::
Emitter:: emit() for signals from multiply-inherited base classes on MSVC — it was due to an insufficiently tested workaround for a template deduction limitation in the compiler (see mosra/ corrade#51) - Interconnect::
Emitter:: emit() now works correctly on MSVC for signals from classes where multiple and/or virtual inheritance is involved (see mosra/ corrade#51) - Fixed CORRADE_
COMPARE_ WITH() to be callable with expressions such as *comparator
- Fixed Utility::
Tweakable to work correctly with buildsystems using absolute paths for __FILE__
macros (such as Makefiles, Ninja is using relative paths). See mosra/corrade#61. - In some corner cases, automatic registering / unregistering of Utility::
Resource data happens more than once. While this was allowed for registration, the unregistration caused an assert to be fired. Fixed this to be allowed on both. Utility::Directory::copy()
wasn't properly freeing both opened files if one of them failed to open (see mosra/corrade#70) - Interconnect::
Emitter:: emit() (and signal/slot connections in general) now work correctly with non-copyable arguments - Fixed Utility::
Debug:: isTty() (and thus also TestSuite colored output) to reliably work on macOS. Because Xcode output window doesn't support ANSI color escape codes, tt was relying on an undocumented $XPC_SERVICE_NAME
variable that was always defined inside Xcode to disable colored output. Nowadays this variable is sometimes defined outside as well, making the check unreliable. Fixed by testing for$TERM
instead, see mosra/corrade#73 for more information.
Deprecated APIs
- Single-argument
Utility::Arguments::setHelp()
is now deprecated in favor of Utility::Arguments:: setGlobalHelp() to avoid it being used for documenting named arguments by accident. Utility::Directory::fileExists()
is now deprecated in favor ofUtility::Directory::exists()
. It was named like this to prevent it from looking like it works on directories only, but such name then caused people to ask if it works on directories as well, not helping anything.Interconnect::Connection::isConnected()
andInterconnect::Connection::disconnect()
are deprecated and print a warning at runtime as the redesigned internals of the Interconnect library now make it impossible to check that the original Interconnect::Emitter object still exists. Use Interconnect:: Emitter:: isConnected() and Interconnect:: disconnect() instead. - Re-connecting a disconnected signal using
Interconnect::Connection::isConnectionPossible()
andInterconnect::Connection::connect()
is not possible anymore in order to make the Interconnect library more efficient. These two functions are now deprecated and just returningthe value of (also deprecated)isConnected()
. - Signatures of TestSuite::
Comparator methods were changed in order to support new features. The old variant with operator()() returning a bool
andprintErrorMessage()
instead of printMessage() is still supported for backwards compatibility but custom comparators are strongly advised to upgrade
Potential compatibility breakages, removed APIs
Containers::StridedArrayView<T>
is now Containers::StridedArrayView<dimensions, T> and all code that was using it directly before needs to be changed to use Containers:: StridedArrayView1D<T> instead; the constructor is also changed to take a linear array view in addition for better bounds checking - Support for std::
tuple and std:: string in Utility:: Debug is now provided through a separate header, Corrade/ Utility/ DebugStl.h, to speed up compile times. Since including it for backwards compatibility would practically revert the optimization, you have to #include
it explicitly where needed. - Utility::
formatString(), Utility:: formatInto() taking a std:: string and support for formatting std:: string through the Utility:: format() family of APIs is now provided through a separate header, Corrade/ Utility/ FormatStl.h, to speed up compile times. Since including it for backwards compatibility would practically revert the optimization, you have to #include
it explicitly where needed. - TestSuite::
Compare:: SortedContainer was split from the Corrade/ TestSuite/ Compare/ Container.h header into Corrade/ TestSuite/ Compare/ SortedContainer.h to isolate the heavy <algorithm>
include. Backwards compatibility is not provided in order to reduce compile times, please include the new header now. - The CORRADE_
ENUMSET_ FRIEND_ OPERATORS() macro now provides both declarations and definitions of enum set operators. This means it has to be used alone, without CORRADE_ ENUMSET_ OPERATORS(), as that would lead to duplicate definitions. - The
CORRADE_BENCHMARK
,CORRADE_BENCHMARK_DISCARD
,CORRADE_BENCHMARK_YELLOW
andCORRADE_BENCHMARK_RED
environment variables used by TestSuite::Tester were renamed to CORRADE_TEST_BENCHMARK
,CORRADE_TEST_BENCHMARK_DISCARD
,CORRADE_TEST_BENCHMARK_YELLOW
andCORRADE_TEST_BENCHMARK_RED
to be consistent with remaining variables understood by test suite executables.
Documentation
- Updated docs of the Corrade/
Utility/ Macros.h header mentioning what CORRADE_ DEPRECATED() macros work on what compiler (see mosra/ corrade#46) - Fixed Gentoo build instructions (see mosra/
corrade#64) - Various other doc updates (see mosra/
corrade#69, mosra/ corrade#71 and mosra/ corrade#76)
2019.01
Released 2019-02-04, tagged as v2019.01.
Dependency changes
- Minimal supported GCC version is now 4.8.1, GCC 4.7 is not supported anymore. Minimal Clang version is now 3.3, since that's the first version with a complete C++11 support. See also mosra/
magnum#274. - Minimal supported CMake version is now 3.1. Older versions are not supported anymore and all workarounds for them were removed. Download a prebuilt release of a newer version if you need to use Corrade on older systems (such as Ubuntu 14.04 or Debian 8). See also mosra/
magnum#274.
New features
- Various Corrade features are now being available also as single-header libraries for easier integration into your projects. See Single-header libraries for more information.
Containers library
- New Containers::
Pointer class, a lightweight equivalent to std:: unique_ptr - New Containers::
Reference class, a lightweight equivalent to std:: reference_wrapper - New
Containers::NoCreate
tag for constructing instances equivalent to a moved-from state. This tag was used in Magnum already, moving it here to make it available to a wider set of APIs. - New Containers::
optional(Args&&... args) overload for in-place initialization - Added r-value overloads to Containers::
Optional:: operator*() allowing you to easily take the value out of a r-value optional - Opt-in STL compatibility for Containers::
Optional, allowing for explicit conversion from and to std:: optional in C++17 - New Containers::
arrayCast(StridedArrayView<T>) overload for casting strided array views
Utility library
- Asserts from the Corrade/
Utility/ Assert.h can now use the standard assert()
if CORRADE_STANDARD_ ASSERT is defined - It's now possible to provide custom implementation for any assertion macro from Corrade/
Utility/ Assert.h by placing a #define
before including the header - Initial implementation of a Utility::
FileWatcher utility for monitoring changes to a file (see also mosra/ corrade#54) - New Utility::
Tweakable class, implementing tweakable constants for hot-reload - Added Utility::
print() and Utility:: printError() convenience functions for Utility:: formatInto() - It's now possible to print std::
nullptr_t with Utility:: Debug
Changes and improvements
- The CORRADE_
CXX_ STANDARD macro has been moved to the top-level Corrade/ Corrade.h from Corrade/ Utility/ Macros.h so it's available everywhere unconditionally
Containers library
- The Containers::
StridedArrayView class is now constexpr
, allowing it to be used to describe data layout at compile-time - The end() and cend() APIs in Containers::
ArrayView and Containers:: StaticArrayView are now constexpr
the same way begin() / cbegin() is - Slicing APIs in Containers::
ArrayView and Containers:: StaticArrayView are now constexpr
- Bounds checking in compile-time-sized Containers::
StaticArray:: prefix() and Containers:: StaticArrayView:: prefix() is now done at compile time as well - The "initializer list" Containers::
StaticArray:: StaticArray(Args&&... args) constructor is now implicit instead of explicit for easier use
PluginManager library
- The PluginManager::
Manager:: instantiate() and PluginManager:: Manager:: loadAndInstantiate() functions now return Containers:: Pointer instead of std:: unique_ptr for improved compile times - Plugin interfaces now have the pluginInterface() function optional to make implementing hot-reload interfaces less verbose
Utility library
- Prefixed or prefix-ignoring Utility::
Arguments now work better with 3rd party argument parsers which may be less restrictive about argument name format; arguments that are ignored are not checked for key validity anymore (see mosra/ magnum#305)
Build system
- Corrade now has a Conan package. See Conan package for more information. See also mosra/
corrade#57. - Corrade is now available through Hunter CMake-driven package manager. See Hunter package for more information. See also mosra/
magnum#298. - The
package/msys
directory now containsPKGBUILD
s for MSYS2. See MSYS2 packages for more information. See also mosra/corrade#56.
Bug fixes
- It was not possible to use TestSuite::
Compare:: File with CORRADE_ COMPARE_ WITH() because its symbols were not exported by mistake - The
FILES
section in corrade_add_ test() was mistakenly ignored everywhere except Android and Emscripten, making cross-platform testing more prone to errors. Now ctest
properly fails when theFILES
section contains a file that doesn't exist. - The Containers::
ArrayView:: operator bool() and Containers:: StaticArrayView:: operator bool() operators were not constexpr
by accident
Deprecated APIs
Containers::ScopedExit
is deprecated, use Containers::ScopeGuard instead - All uses of std::
unique_ptr are replaced with Containers:: Pointer (affecting mainly the PluginManager:: Manager class). The types are implicitly move-convertible to each other if the Corrade/ Containers/ PointerStl.h header is included. The header is included where needed if CORRADE_ BUILD_ DEPRECATED is enabled. To ensure your code keeps with future versions of Magnum, either switch your code to use Containers:: Pointer as well or include the Corrade/ Containers/ PointerStl.h header explicitly.
Potential compatibility breakages, removed APIs
- Removed
Containers::ArrayReference
, which was deprecated since 2015. Use Containers::ArrayView instead. - Removed
Containers::Array::zeroInitialized()
andContainers::Array::from()
, which were deprecated since 2015. Use Containers::Array:: Array(ValueInitT, std:: size_t) and Containers:: Array:: Array(InPlaceInitT, std:: initializer_list<T>) instead. - Removed
Utility::Arguments::setHelpKey()
, which was deprecated since 2016. Its functionality was merged into Utility::Arguments:: setHelp(). - Removed
Utility::Debug::setOutput()
, which was deprecated since 2016 and superseded by Utility::Debug scoped output - Removed
Utility::Debug::noNewlineAtTheEnd()
, which was deprecated since 2016 and superseded by Utility::Debug:: Flag:: NoNewlineAtTheEnd - Removed
Utility::sleep()
which was deprecated since 2016. Use Utility::System:: sleep() instead. - Removed
TestSuite::Tester::BenchmarkType::WallClock
,TestSuite::Tester::BenchmarkUnits::Time
andTestSuite::Tester::BenchmarkUnits::Memory
which were deprecated since January 2017, not long after introducing the benchmark functionality itself. Use TestSuite::Tester:: BenchmarkType:: WallTime, TestSuite:: Tester:: BenchmarkUnits:: Nanoseconds and TestSuite:: Tester:: BenchmarkUnits:: Bytes instead. - Removed
CORRADE_*_LIBRARIES
andCORRADE_*_INCLUDE_DIRS
CMake variables, which were deprecated in favor ofCorrade::*
imported targets in 2016. The deprecatedCORRADE_CXX_FLAGS
variable is still present, however.
Documentation
- The user-definable macros CORRADE_
NO_ ASSERT and CORRADE_ GRACEFUL_ ASSERT now have dedicated documentation, instead of being casually mentioned on various places and impossible to search for.
2018.10
Released 2018-10-23, tagged as v2018.10.
New features
Containers library
- New
Containers::ScopedExit
helper class - New Containers::
StridedArrayView class for providing access to interleaved data - New front() and back() accessors for all array and array view types
- Added Containers::
Optional:: operator=(NullOptT) for resetting an optional value without requiring the type to be movable - Added fixed-size prefix() overload to all Array classes
PluginManager library
- Ability to change plugin-specific configuration globally using PluginManager::
PluginMetadata:: configuration() — compared to modifying instance-specific configuration through PluginManager:: AbstractPlugin:: configuration(), this can be done even before a plugin is loaded and affects all plugin instances loaded later through the same manager
Utility library
- New Utility::
formatString() and Utility:: formatInto() functions for Python-style zero-allocation string formatting - Added Utility::
Arguments:: prefix(), Utility:: Arguments:: isParsed() - New
Utility::String::viewBeginsWith()
andUtility::String::viewEndsWith()
utilities that take Containers::ArrayView instead of std:: string as a first parameter - New Utility::
String:: replaceFirst() and Utility:: String:: replaceAll() utilities for replacing substrings
Changes and improvements
Containers library
- It's no longer a compile error to call Containers::
arrayView() / Containers:: staticArrayView() on a type that's already an Containers:: ArrayView / Containers:: StaticArrayView
PluginManager library
- Plugins are now loaded from the filesystem in an alphabetical order for predictable behavior across different systems
TestSuite library
- Adapted Emscripten test runner markup for consistency with the m.css theme used in Magnum
- It's now possible to have non-copyable and non-moveable TestSuite::
Comparator specializations
Utility library
- Utility::
Arguments:: value() and Utility:: Arguments:: isSet() now check that the arguments were already successfully parsed to prevent accidentally forgotten calls to Utility:: Arguments:: parse() - Utility::
Arguments is now move-only to avoid accidental copies — it's not meant to be used as a general storage for parsed arguments, only a parser - Utility::
String:: stripPrefix() and Utility:: String:: stripSuffix() have now zero-allocation implementation
Build system
- There's now a PPA for Ubuntu packages. See Packages for Debian, Ubuntu and derivatives for more information.
- The Resource compiler utility is now fully standalone even with shared builds to minimize annoying first-time-use issues. It's also possible to build just this utility without anything else for example for crosscompiling, by enabling only
WITH_RC
and disabling all other CMake options. - Due to changes in Xcode 10, CMake before 3.12 would fail during the build of Corrade. To prevent that, when Xcode 10 is detected, the build aborts with a clear message upfront, telling the user to upgrade to CMake 3.12. See mosra/
corrade#52 and cmake/ cmake#18099.
Bug fixes
- Calling PluginManager::
Manager:: setPluginDirectory() could lead to plugin aliases being forgotten in some cases - Worked around a misoptimization of Utility::
Sha1 when using GCC 6 with -O3 on Raspberry Pi Model 3 B+ (AArch64) (GCC 8 works properly again). See mosra/ corrade#45. - It was not possible to use the Interconnect::
Emitter class with virtual base classes on 32-bit Windows due to an incorrect assumption about member function pointer sizes (see mosra/ magnum-extras#7) - Assertions were not removed if both CORRADE_
NO_ ASSERT and CORRADE_ GRACEFUL_ ASSERT was defined
Documentation
- All code snippets are now compiled, ensuring no deprecated APIs are used and no accidental compile errors are present
- TestSuite::
Comparator documentation mistakenly stated that it's possible to have multiple operator()()
overloads for a single pseudo-type. Due to implementation limitations it's not.
Changelogs for previous versions are available in Archived changelogs.