Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.


Artifact ID: 4310dd105f23ab80c33ca92f2fbe6a89c21a1c66e18216adbd94aaaa3549732d
Page Name:Cxxomfort
Date: 2018-11-10 22:38:19
Original User: luismachuca
Parent: b4a896f8c3d86f45a17ed0c4f918ccdee2eb87d4
Comfort, n. [3]

A consolation; something relieving suffering or worry.

"We still have the spare tire? That's a comfort at least."


Cxxomfort (cxx as in C++, comfort as in comfort) is a small, header-only library that backports some of the nifty goodies and features from the more recent C++ Standards to previous Standards such as C++03 or C++11. I wrote it originally to facilitate my working with the evolving C++ standard as I was getting back into the language. It is intended to reduce the amount and stress of code rewrite while at the same time assisting in backwards and forwards portability.

Current version: 20181104 (.79)

Quickie Links

Quick&Dirty Install and Use Features Examples (external) Issues

Quick & Dirty


fossil clone cxxomfort.fossil
fossil open cxxomfort.fossil


Using this library is as simple as writing C++ code. Include the cxxomfort header in your code:

#include <cxxomfort/cxxomfort.hpp>
// or #include <cxxomfort/base.hpp> if you only plan to use the basic features
# compile with:
(compiler_options...) -I /path/to/cxxomfort ...

Project Documentation

You can include only cxxomfort/base.hpp in library code if you only need the base subset of cxxomfort features, without TR1-related utilities or any other sort of advanced features. Features for more information.

  • BehaviourMacros
  • Features - what is backported or implemented from various C++ Standards
  • Supplements specific to cxxomfort, such as extra algorithms, foreach loops, local function emulation, fixed_vector, etc...
  • Extras that don't take part of the default distribution, such as implementation of simple ranges, etc...
  • Transparent Headers

Frequently asked questions? FAQ.

Looking for usage examples?


The purpose of this library is to ease writing natural-feeling, forwards-compatible code once. As such, some design decisions are made that might conflict with conflict with certain pedantic "coding styles". For a quick, uncomprehensive check read Rationale, and also take a look at for evolution of the rationale.

The library does not aim to be perfect - that way lies madness, suffering, and suffering leads to anger, and anger leads to overused lines from movies. Instead, it aims to be "good enough" for the backports to be usable as far back as possible Standards-wise - all while remaining relatively simple.

For a list features included in this library and what are the Standard Proposals they come from check Implementation Status.

Credits to the various solutions in Credits.

License information in the included LICENSE.txt file.

Q&A / reports at luis[dot]machuca[at]gmail[dot]com or file a request in the ticket system.