xstd is a C++ utility library that extends the STL with practical helpers and ergonomic abstractions to reduce boilerplate and speed up application prototyping.
It is designed to feel like a natural extension of the standard library
while staying simple, explicit, and easy to adopt.
xstd uses the standard build2 CI service to build and test its source code with a variety of build configurations.
For a thorough list of requirements, see the manifest file.
To see detailed information about the current build status, set up xstd for development and run bdep ci.
xstd deliberately targets the newest C++ language standards and makes extensive use of recently standardized features.
As such, it requires a modern C++ compiler with strong support for the latest standards (typically recent versions of Clang or GCC).
xstd relies on the build2 toolchain for building and
dependency management.
Install it via your system's package manager or follow the instructions in The build2 Installation Manual to build it from source.
If you are new to build2, see The build2 Toolchain Introduction and The build2 Build System Manual for more information.
- Add this repository to the
repositories.manifestof yourbuild2project. To track the latest development version, append#mainto the repository location.
:
role: prerequisite
location: https://github.com/lyrahgames/xstd-cpp.git
- In the
manifestfile of eachbuild2package that requires it, declare a dependency onlibxstd. An optional version constraint may be specified.
depends: libxstd == 0.1.0
- In every
buildfilethat defines targets depending onxstd, import the library and add it as dependency.
import xstd = libxstd%lib{xstd}
exe{myexe}: {hxx cxx}{**} $xstd
Currently, xstd does not expose any public configuration options.
This README.md currently contains all project documentation.
Additional documentation may be added in the future as the project evolves.
No usage examples or tutorials are currently provided. They will be added as the library matures.
You can make a build2 package available for non-build2 projects by following these essential steps.
For more information, consult The build2 Toolchain Introduction: Package Consumption and The build2 Toolchain Introduction: Using Unpackaged Dependencies.
- Create a build configuration for C/C++-based
build2packages.
bpkg create -d build2-packages cc \
config.cxx=g++ \
config.cc.coptions="-O3 -march=native" \
config.install.root=/usr/local \
config.install.sudo=sudo
- Fetch the repository's packages and build them.
bpkg build https://github.com/lyrahgames/xstd-cpp.git
- Install the built package.
bpkg install libxstd
- Optionally, uninstall the built packages when you do not need them any longer.
bpkg uninstall libxstd
- To upgrade the package, fetch all new information and uninstall the older version. Afterwards, build the new version and install it.
bpkg fetch
bpkg status
bpkg uninstall libxstd
bpkg build libxstd
bpkg install libxstd
These steps prepare the repository for development.
Familiarity with build2 is recommended.
For full details, see The build2 Toolchain Introduction.
- Clone the repository.
git clone https://github.com/lyrahgames/xstd-cpp.git
cd xstd-cpp
- Use
bdepto create the initial build configuration. If not stated otherwise, it will be placed within the previously created project-specific directory. For example, the command below shows how to create and initialize a configuration namedgcc-releasewith installation and distribution support.
bdep init -C @gcc-release cc \
config.cxx=g++ \
config.cxx.coptions="-O3 -march=native" \
config.install.root=../.install \
config.dist.root=../.dist
- Common Development Tasks
- Use
bdepto print the status of project packages and their immediate dependencies.
bdep status -i
- Use
bto build and test the source code.
b # Build all the code.
b test # Only build and run the tests.
b {clean update} # Clean build all the code.
b {clean update test} # Clean build all the code and run the tests.
- Similarly, to build and test the source in a specific build configuration with
bdep, run the following commands.
bdep update @gcc-release
bdep test @gcc-release
bdep clean @gcc-release
- Use
bto test the installation of the project. In the example configurationgcc-releasecreated above, the installation directory.installis part of the development folder.
b install
b uninstall
- Use
bto test the distribution of the project's packages. In the example configurationgcc-releasecreated above, the directory for distributions.distis part of the development folder.
b dist: libxstd
- After thoroughly testing the aforementioned steps, make a commit and leverage
build2's standard CI service to simultaneously build and test the project across a range of build configurations.
bdep ci
A formal API reference is not yet available. For now, you can explore the library’s source files directly. The inline comments provide guidance on the API usage and implementation details.
All notable changes to this project are documented in CHANGELOG.md.
The changelog follows the Keep a Changelog and Common Changelog formats.
This project also adheres to Semantic Versioning to clearly communicate version changes and compatibility.
Contributions are welcome and greatly appreciated! Please start by opening an issue to report a bug or suggest an improvement. This helps us coordinate efforts and avoid duplicate work. You are then welcome to submit a pull request that references the issue.
The copyright for the code is held by the contributors of the code.
The revision history in the version control system is the primary source of authorship information for copyright purposes.
Please see individual source files for appropriate copyright notices.
For more information, see the file AUTHORS.md.
xstd is free software, distributed under the terms of the GNU General
Public License as published by the Free Software Foundation,
version 3 of the License (or any later version). For more information,
see the GNU General Public License or the file COPYING.md.
xstd is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Copyright years on xstd source files may be listed using range notation, e.g., 1987-2012, indicating that every year in the range, inclusive, is a copyrightable year that could otherwise be listed individually.
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.