Header-only TOML config file parser and serializer for C++17 (and later!).


Releases C++17 C++20 TOML MIT license CircleCI Mentioned in Awesome C++

toml++ homepage

This README is fine, but the toml++ homepage is better.

Library features

  • Header-only
  • Supports the latest TOML release (v1.0.0), plus optional support for some unreleased TOML language features
  • C++17 (plus some C++20 features where available, e.g. experimental support for char8_t strings)
  • Proper UTF-8 handling (incl. BOM)
  • Works with or without exceptions
  • Doesn't require RTTI
  • First-class support for serializing to JSON
  • Tested on Clang (6+), GCC (7+) and MSVC (VS2019)
  • Tested on x64, x86 and ARM

Basic usage

The following example favours brevity. If you'd prefer full API documentation and lots of specific code snippets instead, visit the project homepage

Given a TOML file configuration.toml containing the following:

name = "toml++"
authors = ["Mark Gillard <[email protected]>"]

cpp = 17

Reading it in C++ is easy with toml++:

#include <toml.hpp>
#include <fstream> //required for toml::parse_file()

auto config = toml::parse_file( "configuration.toml" );

// get key-value pairs
std::string_view library_name = config["library"]["name"].value_or(""sv);
std::string_view library_author = config["library"]["authors"][0].value_or(""sv);
int64_t depends_on_cpp_version = config["dependencies"]["cpp"].value_or(0);

// modify the data
config.insert_or_assign("alternatives", toml::array{

// iterate & visit over the data
for (auto&& [k, v] : config)
    v.visit([](auto& node) noexcept
        std::cout << node << "\n";
        if constexpr (toml::is_string<decltype(node)>)

// re-serialize as TOML
std::cout << config << "\n";

// re-serialize as JSON
std::cout << toml::json_formatter{ config } << "\n";

You'll find some more code examples in the examples directory, and plenty more as part of the API documentation.

Adding toml++ to your project

toml++ comes in two flavours: Single-header and Regular. The API is the same for both.

🍦 Single-header flavour

  1. Drop toml.hpp wherever you like in your source tree
  2. There is no step two

🍨 Regular flavour

  1. Add tomlplusplus/include to your include paths
  2. #include <toml++/toml.h>


Add tomlplusplus/2.3.0 to your conanfile.
This adds the single-header version by default, but you can specify the regular version using "multiple_headers": True.


Add tomlpp to your package.json5, e.g.:

depends: [

What is DDS?


vcpkg install tomlplusplus

Other environments and package managers

toml++ is a fairly new project and I'm not up-to-speed with all of the available packaging and integration options in the modern C++ ecosystem. I'm also a cmake novice, for better or worse. If there's an integration option missing be assured that I fully support it being added, and welcome pull requests!


A number of configurable options are exposed in the form of preprocessor #defines. Most likely you won't need to mess with these at all, but if you do, set them before including toml++.

Option Type Default Description
TOML_HEADER_ONLY boolean 1 Disable this to explicitly control where toml++'s implementation is compiled (e.g. as part of a library).
TOML_API define undefined API annotation to add to public symbols (e.g. __declspec(dllexport) on Windows).
TOML_ASSERT(expr) function macro assert(expr)
(or undefined)
Sets the assert function used by the library.
TOML_CONFIG_HEADER string literal undefined Includes the given header file before the rest of the library.
TOML_EXCEPTIONS boolean per your compiler's settings Sets whether the library uses exceptions.
TOML_IMPLEMENTATION define undefined Define this to enable compilation of the library's implementation. Meaningless if TOML_HEADER_ONLY is 1.
TOML_LARGE_FILES boolean 0 Uses 32-bit integers for line and column indices (instead of 16-bit).
TOML_OPTIONAL_TYPE type name undefined Overrides the optional<T> type used by the library if you need something better than std::optional.
TOML_PARSER boolean 1 Disable this to prevent inclusion of the parser-related parts of the library if you don't need them.
TOML_SMALL_FLOAT_TYPE type name undefined If your codebase has an additional 'small' float type (e.g. half-precision), this tells toml++ about it.
TOML_SMALL_INT_TYPE type name undefined If your codebase has an additional 'small' integer type (e.g. 24-bits), this tells toml++ about it.
TOML_UNRELEASED_FEATURES boolean 0 Enables support for unreleased TOML language features not yet part of a numbered version.
TOML_WINDOWS_COMPAT boolean 1 on Windows Enables support for transparent conversion between wide and narrow strings in some places when building for Windows.

A number of these have ABI implications; the library uses inline namespaces to prevent you from accidentally linking incompatible combinations together.

TOML Language Support

At any given time the library aims to support whatever the most recently-released version of TOML is, with opt-in support for a number of unreleased features from the TOML master and some sane cherry-picks from the TOML issues list where the discussion strongly indicates inclusion in a near-future release.

The library advertises the most recent numbered language version it fully supports via the preprocessor defines TOML_LANG_MAJOR, TOML_LANG_MINOR and TOML_LANG_PATCH.

🔸 Unreleased language features:

  • #516: Allow newlines and trailing commas in inline tables
  • #562: Allow hex floating-point values
  • #644: Support + in key names
  • #671: Local time of day format should support 09:30 as opposed to 09:30:00
  • #687: Relax bare key restrictions to allow additional unicode characters
  • #709: Include an \xHH escape code sequence

#define TOML_UNRELEASED_FEATURES 1 to enable these features (see Configuration).

🔹 TOML v1.0.0:

All features supported, including:

  • #356: Allow leading zeros in the exponent part of a float
  • #567: Control characters are not permitted in comments
  • #571: Allow raw tabs inside strings
  • #665: Make arrays heterogeneous
  • #766: Allow comments before commas in arrays

🔹 TOML v0.5.0:

All features supported.


Contributions are very welcome! Either by reporting issues or submitting pull requests. If you wish to submit a pull request, please see CONTRIBUTING for all the details you need to get going.

License and Attribution

toml++ is licensed under the terms of the MIT license - see LICENSE.

UTF-8 decoding is performed using a state machine based on Bjoern Hoehrmann's 'Flexible and Economical UTF-8 Decoder'.

With thanks to:


For bug reports and feature requests please consider using the issues system here on GitHub. For anything else though you're welcome to reach out via other means. In order of likely response time:

  • build(meson): Update path for .pc and .cmake files

    build(meson): Update path for .pc and .cmake files

    This changes install directories to more common ones: .pc --> share/pkgconfig to lib/pkgconfig and libdata/pkgconfig on FreeBSD hosts .cmake --> share/cmake to lib/cmake

    opened by diizzyy 37
  • Copying nodes

    Copying nodes

    Is your feature request related to a problem? Please describe. I am currently in the process of replacing a json library with your toml library, and I have encountered this issue a couple times, where I needed to make a copy of a node. In the first case, I was able to do a move. In other cases, I need a copy. Specifically, I have a table with one element that is an array. I want to be able to copy that array to a second element in that table.

    Existing table: [table] foo = [1, 2, 3]

    In pseudo-code: auto *array = table.get("foo"); table["bar"] = *array;

    Describe the solution you'd like I am pretty that I can accomplish this by manually iterating over the elements in the toml::node.

    Describe alternatives you've considered I was surprised to find that copy constructors were deleted.

    Additional context Are there, or will there be any plans to include node copying in the future?

    opened by whiterabbit963 37
  • Deserialization of arrays into std::vector and std::map

    Deserialization of arrays into std::vector and std::map

    A few ideas:

    Idea 1:

    Signature = [ 0x44, 0x4F, 0x53, 0x00 ]

    Deserialize into std::vector<uint8_t> or std::vector<uint16_t> or std::vector<uint32_t> or std::vector<uint64_t> or their signed counterparts?

    Idea 2:

    Signature = [ 'M', 'S', 'C', 'F' ]

    Deserialize into std::string or std::wstring or std::vector<char> or std::vector<wchar_t>? I understand this one might be a problem because there is no guarantee that each array index will correspond to a single character.

    Idea 3:

    DenominationTable = { 33 = 1000, 30 = 100, 32 = 500, 34 = 2000 }

    Deserialize into std::map<string, int> or std::map<wstring, int>?

    Please let me know what you think.

    opened by levicki 31
  • Failure to compile with intel compiler on linux

    Failure to compile with intel compiler on linux


    toml++ version and/or commit hash:
    toml.hpp v2.3.0 [9be51e4]

    icpc (ICC) 20191121 icpc (ICC) 20180804

    gcc backend: 7.4.0 (also tried 9.3.0)

    C++ standard mode (e.g. 17, 20, 'latest'):

    Target arch (e.g. x64):
    x64 (linux)

    Library configuration overrides:

    Relevant compilation flags:

    Describe the bug

    Compiling a simple test program with icpc fails, complaining about issues with TOML_ALWAYS_INLINE. The same example works fine when compiling with gcc (the same version used as the backend for icpc). Other versions of gcc on the backend similarly fail.

    In file included from test.cpp(3):
    % icpc test.cpp -std=c++17
    toml.hpp(1119): error #77: this declaration has no storage class or type specifier
    ... [[hundreds of lines of errors]]

    Steps to reproduce (or a small repro code sample)

    #include <iostream>
    #include <fstream> //required for parse_file()
    #include "toml.hpp"
    int main(int argc, char** argv)
        toml::table tbl;
            tbl = toml::parse_file(argv[1]);
            std::cout << tbl << "\n";
        catch (const toml::parse_error& err)
            std::cerr << "Parsing failed:\n" << err << "\n";
            return 1;
        return 0;

    Additional information

    Forcing #define TOML_ALWAYS_INLINE __forceinline will compile with no errors, but fail to link.

    /tmp/icpcJYElhL.o: In function `toml::v2::default_formatter<char>::print(toml::v2::table const&)':
    test.cpp:(.text._ZN4toml2v217default_formatterIcE5printERKNS0_5tableE[_ZN4toml2v217default_formatterIcE5printERKNS0_5tableE]+0x50): undefined reference to `toml::v2::node::type() const'
    ... [[et al.]]
    opened by blackwer 30
  • Is the

    Is the "multiple_headers" Conan option working?


    toml++ version and/or commit hash:2.3.0

    Compiler:AppleClang 12

    C++ standard mode (e.g. 17, 20, 'latest'):17

    Target arch (e.g. x64):x64

    Library configuration overrides:

    Relevant compilation flags:

    Describe the bug

    I may about to be a waste of your time but I'm at a loss. I'm trying to get toml++ through Conan and I wanted to have to separate smaller headers rather than the amalgamated header. Because I'm using Conan, I used the multiple_headers options set to True but it seems I only ever got the single header file.

    I'm still a beginner with Conan so it's probably something stupid I'm doing incorrectly but I don't know what. I've tried a couple different things already, all leading to the same outcome. I've made sure to do conan remove tomlplusplus between every attempt to make sure I'm "starting fresh"...

    Steps to reproduce (or a small repro code sample)

    Because I'm also using CMake, I first tried to include toml++ like so:

                    BUILD missing

    but that didn't appear to work. I ended up with just the single file ~/.conan/data/tomlplusplus/2.3.0/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/toml.hpp. I also tried conan install . from the command line with both a conanfile.txt and a conanfile.py but neither had the desired effect.

    Here's the conanfile.txt I tried:


    and the conanfile.py I tried:

    from conans import ConanFile, CMake
    class TomlPlusPlusConan(ConanFile):
       settings = "os", "compiler", "build_type", "arch"
       requires = "tomlplusplus/2.3.0"
       generators = "cmake"
       default_options = {"tomlplusplus:multiple_headers": True}

    Additional information

    Regardless of the mechanism through which Conan is triggered, I always end up with a conaninfo.txt file that looks like this:


    and I always end up with a single file toml.hpp in the folder ~/.conan/data/tomlplusplus/2.3.0/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include.

    Again, it's probably something stupid on my part due to my inexperience with Conan but after a couple of hours fiddling with this, filing an issue is the best I could think of...

    opened by thierryseegers 26
  • Add implicit conversion operators from node to node_view

    Add implicit conversion operators from node to node_view

    Hello! I've made a couple of changes to loosen restrictions on the use of node_view. Primarily, I added implicit conversion operators from node to node_view (const and mutable variants). Also, I re-enabled the move assignment operator on node_view.

    This was motivated by me running into trouble while trying to write code to traverse a table procedurally. Basically, I wanted to do something like this:

    toml::node_view<const toml::node> child = myTable;
    for (auto key : keyPath)
        child = child[key];

    where I'm descending into a table using a list of keys in keyPath.

    In opting to do this by adding implicit conversion operators (as opposed to e.g. adding a constructor on node_view, or explicit conversion functions), I was guided by std::string, which similarly has an implicit conversion to std::string_view. String views are always const, but here I wanted to allow either const or non-const node_views so I added both.

    I also found that statements like child = child[key] above want the move assignment operator, which was disabled. I didn't see any reason for that to be disabled, especially considering that copy assignment is enabled, so I turned it back on.

    I'm open to discussion on this if there are other ways you'd prefer to accomplish this, though. 🙂

    Pre-merge checklist

    • [x] I've read CONTRIBUTING.md
    • [ ] I've added new test cases to verify my change
    • [x] I've regenerated toml.hpp (how-to)
    • [ ] I've updated any affected documentation (didn't do this as I don't have Doxygen installed)
    • [ ] I've rebuilt and run the tests with at least one of:
      • [ ] Clang 6 or higher
      • [ ] GCC 7 or higher
      • [x] Visual Studio 2019
    • [x] I've forever enshrined myself in glory by adding myself to the list of contributors in README.md
    opened by Reedbeta 24
  • C++20 MSVC Syntax Error [CMake]

    C++20 MSVC Syntax Error [CMake]



    C++ standard mode (e.g. 17, 20, 'latest'):

    Target arch (e.g. x64):

    Exceptions enabled:
    I am using the default (/EHsc) Exceptions

    Relevant toml++ configuration customizations:
    No overrides are used

    Relevant compilation flags:

    Describe the bug

    Syntax/Unknown-Type/Traits errors.

    toml.hpp(8103): error C2589: '(': illegal token on right side of '::'
    toml.hpp(8612): note: see reference to function template instantiation 'int64_t toml::impl::abi_impl_noex::parser::parse_integer<16>(void) noexcept' being compiled
    toml.hpp(8103): error C2062: type 'unknown-type' unexpected
    toml.hpp(8103): error C2144: syntax error: 'unknown-type' should be preceded by '('
    toml.hpp(8103): error C2059: syntax error: ')'
    toml.hpp(8104): error C2143: syntax error: missing ';' before '{'
    toml.hpp(8104): error C2059: syntax error: ','
    toml.hpp(8104): error C2059: syntax error: ')'
    toml.hpp(8104): error C2059: syntax error: 'return'
    toml.hpp(8104): error C2059: syntax error: '}'
    toml.hpp(8108): error C2059: syntax error: 'if'
    toml.hpp(8108): error C2653: 'traits': is not a class or namespace name
    toml.hpp(8110): error C2059: syntax error: 'else'
    toml.hpp(8112): error C2059: syntax error: '}'
    toml.hpp(8112): error C2143: syntax error: missing ';' before '}'

    Steps to reproduce (or a small repro code sample)

    Include it in any source file.

    Additional information

    Screenshots of the compiler error: image

    opened by ghost 23
  • tipi.build support for tomlplusplus

    tipi.build support for tomlplusplus

    Hello from tipi.build :D,

    I just added tipi support to your project and was wondering if you'd like to merge so everyone gets a new way of using your cool project.

    If there's any issue with this I'll be happy to sort it out

    Best from Zürich, Yannic / pysco68

    Pre-merge checklist

    • [x] I've read CONTRIBUTING.md
    • [x] I've rebased my changes against the current HEAD of origin/master (if necessary)
    • [x] I've added new test cases to verify my change (added a CI job which uses the tipi-ubuntu docker container)
    • [ ] ~~I've regenerated toml.hpp~~
    • [x] I've updated any affected documentation
    • [x] I've rebuilt and run the tests with at least one of:
      • [x] Clang 6 or higher
      • [ ] GCC 7 or higher
      • [x] MSVC 19.20 (Visual Studio 2019) or higher
    • [ ] ~~I've added my name to the list of contributors in README.md~~
    opened by pysco68 22
  • Update value at path

    Update value at path

    Is your feature request related to a problem? Please describe. It would be very useful to be able to insert or modify a value at a particular path, essentially the inverse of the at_path(...).value_or(...) method chain.

    Describe the solution you'd like Something like tbl.at_path(...).insert_or_update(...). At the moment it seems like I would need to parse the path string myself to find the correct parent table to then call insert_or_assign, which is unfortunate since the path-parsing code already exists in the library. Or is there a canonical way of doing this already that I'm missing?

    opened by jonestristand 20
  • Improve `node` and `node_view` interfaces

    Improve `node` and `node_view` interfaces

    Is your feature request related to a problem? Please describe. The node_view could be made more similar to a std::optional to enhance usability. Also, there's no clean way to extract a generic "number" which can be floating or integer: currently I have to do

    if (node.is_floating_point()) {
        return node.as_floating_point()->get();
    else if (node.is_integer()) {
        return node.as_integer()->get();
    else {

    I know that there's a .is_number() member function, It would be great to have a way to directly extract the number, for example:

    if (node.is_number()) {
        return node.get_number();
    } else {

    In general, it would be great to have a shorter way to get values from a node

    Describe the solution you'd like I think it would be useful to:

    • make node_view more like optional: it currently has a .value_or() member function, but not a throwing .value(), nor a .has_value(), for example.
    • equip node with a member function which return the number it contains, whether it is an integer or a floating point
    • equip node with a member function which returns the value directly or inside an (eventually empty) optional or node_view (which in my opinion are more expressive than a pointer)

    Describe alternatives you've considered For the second issue, an alternative could be make .as_floating_point()->get() implicitly convert the underlying integer, making the following code work:

    if (node.is_number()) {
        return node.as_floating_point()->get();
    opened by rbrugo 20
  • Including toml++ as a subproject

    Including toml++ as a subproject

    Is your feature request related to a problem? Please describe. The Meson build file doesn't define a dependency variable which makes it (as far as I can tell) difficult to use as a subproject (via wraps) in an existing Meson project.

    Describe the solution you'd like From what I can gather from the documentation and several other libraries (to list a few), probably something like

    tomlplusplus_dep = declare_dependency(
      include_directories : inc,
      version : meson.project_version(),

    added at the end of meson.build. I admit I'm not entirely sure if this is the correct way of solving this, so I think an issue is more appropriate than a PR for now.

    opened by stuhlmeier 15
  • Can we have coverage data of test cases?

    Can we have coverage data of test cases?

    Is your feature request related to a problem? Please describe.

    search the cmake files, we have no coverage flags in this project like the external project - json, we can not know, how much code lines we've tested.

    Describe the solution you'd like

    pls add the coverage flags in the cmake system for this project.

    Additional context

    Thank you so much.

    opened by jasmine-zhu 10
  • Is it possible to add support for custom types?

    Is it possible to add support for custom types?

    Is your feature request related to a problem? Please describe.

    Is it possible to add TOML support for custom types, example:

    struct Point {
        int32_t x = 10;
        int32_t y = 20;

    Which would probably look like the following in TOML

    x = 10
    y = 20

    Describe the solution you'd like

    I would like to use it as follow:

    const Point my_point = tbl["custom_point"].value<Point>();

    Additional context

    I am not yet using the library but working thought the API docs I don't see any mention of such options.

    opened by CJCombrink 3
  • Fail to build when imported from a module unit purview

    Fail to build when imported from a module unit purview

    — This problem is reported here more as a backlog than as a real problem. It shouldn't really concern people who don't use state-of-the-art compilers with C++ modules. Nevertheless, @marzer asked me to flag it as a problem to look into at some point.

    Commit: c6deadf61db048feda3998041af8021244368671

    Microsoft Visual C++ 14.32.31326 / May 10, 2022

    C++ standard mode:

    Target arch:

    tomlplusplus will flag C2872 should we try to use it when it is imported from a module unit purview:

    import <sstream>;
    import <iostream>;
    export module uniform; // purview begin...
    import "toml.hpp";     // import inside uniform's purview...
    using namespace std::string_view_literals;
    int main()
      static constexpr std::string_view some_toml = R"(
        name = "toml++"
        authors = ["Mark Gillard <[email protected]>"]
        cpp = 17
        // parse directly from a string view:
          toml::table tbl = toml::parse(some_toml);
          std::cout << tbl << "\n";
        // parse from a string stream:
          std::stringstream ss{ std::string{ some_toml } };
          toml::table tbl = toml::parse(ss); // Error! C2872!
          std::cout << tbl << "\n";
      catch (const toml::parse_error& err)
        std::cerr << "Parsing failed:\n" << err << "\n";
        return 1;
      return 0;
    > Error C2079 'toml::v3::impl::impl_ex::parser::root' uses undefined class 'toml::v3::table'
    bug help wanted 
    opened by wroyca 0
  • Event interface / SAX

    Event interface / SAX

    Is your feature request related to a problem? Please describe. I'd like to consume the input file on the go, without having to create an intermediate DOM representation.

    Describe the solution you'd like A SAX-like parser interface.

    Additional context This would make it easier to use in some memory constrained situations.

    opened by mizvekov 4
  • iterator proxy pair ought to decay to value semantics on demand

    iterator proxy pair ought to decay to value semantics on demand

    Lots of generic STL code would always do:

    for(auto &i : container)

    This prevents the value copy of items being iterated. You have proxy pair in place to prevent this occurring for:

    for(auto i : container)

    Firstly, any compiler which is not MSVC will elide that copy under optimisation if i never escapes or is modified. So your proxy optimisation probably doesn't actually save much, except on MSVC.

    Meanwhile, the lack of value sematics for the second for loop causes much generic code to break. If the code asked for a copy, it expects an as-if copy. If you wish to retain your proxy, you ought to have it implicitly convert to a value type upon demand in order to retain expected semantics.

    opened by ned14 4
  • Preservation of comments and whitespace

    Preservation of comments and whitespace

    Firstly, this is one of those very few libraries I've used where I don't think I'd have done much different myself. Well, possibly I'd have made it always non-throwing. Well done on that, and thank you for making it open source.

    Another thing that I would have done is optional comment and whitespace preservation, such that if you read in a TOML file, and then write it out, comments and whitespace are preserved. This is useful because I'm using your library a bit like how clang-tidy or doxygen do things, where you can dump out a default TOML config, hand edit it, or supply TOML delta files to merge against the default TOML config, and so on. Therefore, dumping out the post-merge TOML file, with all comments also merged, would be ideal.

    For this to work right, you'd need to retain comments and whitespace as an attribute of the first node following the comment. Then, if the node gets replaced by a merge, one could retain the existing comment and whitespace, or replace it with the new comment and whitespace etc.

    I'd personally make this opt-in, as plenty of people don't want to waste CPU nor memory on comments and whitespace. My thanks in advance to you for your consideration!

    opened by ned14 26
  • v3.2.0(Aug 29, 2022)


    • fixed [dotted.table] source columns sometimes being off by one (#152) (@vaartis)
    • fixed spurious Wnull-dereference warning on GCC (#164) (@zaporozhets)
    • fixed print_to_stream ambiguity for size_t (#167) (@acronce)


    • added value type deduction to emplace() methods
    • added toml::path utility type (#153, #156, #168) (@jonestristand, @kcsaul)
    • added config option TOML_CALLCONV
    • added missing relational operators for source_position


    • relaxed cvref requirements of is_homogeneous(), emplace(), emplace_back(), emplace_hint()
    • relaxed mantissa and digits10 requirements of extended float support
    Source code(tar.gz)
    Source code(zip)
  • v3.1.0(Apr 24, 2022)


    • Fixed potential segfault when calling at_path() with an empty string
    • Fixed UB in internal unicode machinery (#144) (@kchalmer)
    • Fixed a number of spurious warnings with Clang 10 (#145, #146) (@chronoxor)


    • Added toml::array::for_each()
    • Added toml::table::for_each()
    • Added support for escape sequence \e when using TOML_ENABLE_UNRELEASED_FEATURES (toml/790)
    • Added support for more unicode in bare keys when using TOML_ENABLE_UNRELEASED_FEATURES (toml/891)


    • Deprecated old TOML_API option in favour new TOML_EXPORTED_X options (it will continue to work as it did before if none of the new function export options are defined)

    Build system:

    • Meson: Added compile_library option (@Tachi107)
    • Meson: Added ubsan_tests and ubsan_examples options
    • Meson: Use system dependencies where available when building tests (@Tachi107)
    Source code(tar.gz)
    Source code(zip)
  • v3.0.1(Jan 13, 2022)

    This is a single-bugfix release to fix an ODR issue for people using header-only mode in multiple translation units. If you aren't seeing linker errors because of toml::array::insert_at(), this release holds nothing of value over v3.0.0.


    • fixed erroneous use of TOML_API causing ODR issue (#136) (@Azarael)
    Source code(tar.gz)
    Source code(zip)
  • v3.0.0(Jan 11, 2022)

    This release is a major version bump, so it's ABI breaks all around. Any changes that are likely to cause migration issues (API changes, build system breakage, etc.) are indicated with ⚠️.


    • ⚠️ fixed toml::table init-list constructor requiring double-brackets
    • ⚠️ fixed TOML_API + extern templates causing linker errors in some circumstances
    • ⚠️ fixed incorrect noexcept specifications on many functions
    • ⚠️ fixed missing TOML_API on some interfaces
    • fixed toml::json_formatter not formatting inf and nan incorrectly
    • fixed a number of spec conformance issues (#127, #128, #129, #130, #131, #132, #135) (@moorereason)
    • fixed an illegal table redefinition edge case (#112) (@python36)
    • fixed documentation issues
    • fixed GCC bug causing memory leak during parse failures (#123, #124) (@rsmmr, @ronalabraham)
    • fixed incorrect handling of vertical whitespace in keys when printing TOML to streams
    • fixed incorrect source position in redefinition error messages
    • fixed missing includes <initializer_list>, <utility>
    • fixed parser not correctly round-tripping the format of binary and octal integers in some cases
    • fixed some incorrect unicode scalar sequence transformations (#125)
    • fixed strong exception guarantee edge-cases in toml::table and toml::array


    • added value flags to array + table insert methods (#44) (@levicki)
    • added support for Unicode 14.0
    • added support for ref categories and cv-qualifiers in toml::node::ref()
    • added magic toml::value_flags constant toml::preserve_source_value_flags
    • added clang's enum annotation attributes to all enums
    • added TOML_ENABLE_FORMATTERS option
    • added toml::yaml_formatter
    • added toml::value copy+move constructor overloads with flags override
    • added toml::table::prune()
    • added toml::table::lower_bound() (same semantics as std::map::lower_bound())
    • added toml::table::emplace_hint() (same semantics as std::map::emplace_hint())
    • added toml::table::at() (same semantics as std::map::at())
    • added toml::node_view::operator==
    • added toml::key - provides a facility to access the source_regions of parsed keys (#82) (@vaartis)
    • added toml::is_key<> and toml::is_key_or_convertible<> metafunctions
    • added toml::format_flags::relaxed_float_precision (#89) (@vaartis)
    • added toml::format_flags::quote_infinities_and_nans
    • added toml::format_flags::indent_sub_tables (#120) (@W4RH4WK)
    • added toml::format_flags::indent_array_elements (#120) (@W4RH4WK)
    • added toml::format_flags::allow_unicode_strings
    • added toml::format_flags::allow_real_tabs_in_strings
    • added toml::format_flags::allow_octal_integers
    • added toml::format_flags::allow_hexadecimal_integers
    • added toml::format_flags::allow_binary_integers
    • added toml::date_time converting constructors from toml::date and toml::time
    • added toml::at_path(), toml::node::at_path() and toml::node_view::at_path() for qualified path-based lookups (#118) (@ben-crowhurst)
    • added toml::array::resize() param default_init_flags
    • added toml::array::replace() (#109) (@LebJe)
    • added toml::array::prune()
    • added toml::array::at() (same semantics as std::vector::at())
    • added parse_benchmark example
    • added operator-> to toml::value for class types


    • ⚠️ toml::format_flags is now backed by uint64_t (was previously uint8_t)
    • ⚠️ toml::source_index is now an alias for uint32_t unconditionally (was previously dependent on TOML_LARGE_FILES)
    • ⚠️ toml::table now uses toml::key as the key type (was previously std::string)
    • ⚠️ toml::value_flags is now backed by uint16_t (was previously uint8_t)
    • ⚠️ made all overloaded operators 'hidden friends' where possible
    • ⚠️ renamed toml::default_formatter to toml::toml_formatter (toml::default_formatter is now an alias)
    • ⚠️ renamed TOML_PARSER option to TOML_ENABLE_PARSER (TOML_PARSER will continue to work but is deprecated)
    • ⚠️ renamed TOML_WINDOWS_COMPAT to TOML_ENABLE_WINDOWS_COMPAT (TOML_WINDOWS_COMPAT will continue to work but is deprecated)
    • applied clang-format to all the things 🎉️
    • exposed TOML_NAMESPACE_START and TOML_NAMESPACE_END macros to help with ADL specialization scenarios
    • improved performance of parser
    • made date/time constructors accept any integral types
    • moved all implementation headers to /impl
    • renamed all implementation headers to .h and 'source' headers to .inl
    • updated conformance tests


    • ⚠️ removed toml::format_flags::allow_value_format_flags
    • ⚠️ removed TOML_LARGE_FILES (it is now default - explicitly setting TOML_LARGE_FILES to 0 will invoke an #error)
    • ⚠️ removed unnecessary template machinery (esp. where ostreams were involved)
    • removed unnecessary uses of final

    Build system:

    • ⚠️ increased minimum required meson version to 0.54.0
    • disabled 'install' path when being used as a meson subproject (#114) (@Tachi107)
    • fixed builds failing with meson 0.6.0 (#117) (@Tachi107)
    • general meson improvements and fixes (#115) (@Tachi107)
    • used override_dependency where supported (#116) (@Tachi107)
    Source code(tar.gz)
    Source code(zip)
  • v2.5.0(Aug 11, 2021)


    • fixed linkage error with windows compat mode
    • fixed TOML_CONSTEVAL broken in MSVC (again)
    • fixed minor documentation bugs
    • fixed cmake project version being incorrect (#110) (@GiulioRomualdi)


    • added support for lowercase 't' and 'z' in datetimes (per spec)
    • added natvis file to cmake install (#106) (@Ryan-rsm-McKenzie)
    • added VS cpp.hint file to cmake install
    • added metafunctions is_container, is_chronological, is_value, is_node, inserted_type_of


    • improved debug code size by removing unnecessary std::forwards and std::moves
    • modernized the CMake build files (#102, #103, #105) (@friendlyanon)
    • updated conformance tests
    Source code(tar.gz)
    Source code(zip)
  • v2.4.0(May 19, 2021)


    • fixed node::value() not retrieving inf and nan correctly
    • fixed dotted kvps being unable to add subtables (#61) (@Validark)
    • fixed linker error on linux ICC (#83) (@blackwer)
    • fixed segfault JSON-formatting a failed parse_result (#96) (@proydakov)
    • fixed spurious newline after JSON formatting a table
    • fixed VS intellisense not detecting TOML_COMPILER_EXCEPTIONS correctly
    • fixed crash with pathologically-nested inputs (#100) (@geeknik)
    • fixed parse_result natvis
    • fixed false-positive char8_t support detection on older compilers
    • fixed unnecessary #include <Windows.h> Windows builds (@BeastLe9enD)
    • fixed TOML_CONSTEVAL breaking on VS 16.10.0pre2
    • fixed spurious warnings with MSVC /Wall
    • fixed missing blank lines between consecutive empty tables/A-o-T
    • fixed unnecessary TOML_API declarations
    • fixed many small documentation issues


    • added proper cmake support (#85) (@ClausKlein)
    • added cmake FetchContent information to documentation (#101) (@proydakov)

    Removals and Deprecations:

    • removed explicit #include <fstream> requirement for parse_file()
    Source code(tar.gz)
    Source code(zip)
  • v2.3.0(Dec 29, 2020)


    • fixed compiler errors caused by <charconv> with Apple-flavoured clang
    • fixed array and table iterators missing iterator_category (#77) (@HazardyKnusperkeks)
    • fixed Wuseless-cast warnings on GCC 10 (#75) (@HazardyKnusperkeks)
    • fixed formatter not correctly line wrapping in some rare circumstances (#73) (@89z)
    • fixed an unnecessary global compiler flag breaking builds when used as a meson subproject (#72) (@jamabr)
    • fixed link error caused by <charconv> on emscripten (#71) (@suy)
    • fixed ambiguity with the toml::literals inline namespace (#69) (@std-any-emplace)
    • fixed formatter emitting superfluous newlines after printing tables (#68) (@std-any-emplace)
    • fixed array and table iterators not converting between const and non-const versions of themselves (#67) (@std-any-emplace)
    • fixed some parser crashes when given pathologically-malformed UTF-8 (#65) (@sneves)
    Source code(tar.gz)
    Source code(zip)
  • v2.2.0(Oct 9, 2020)


    • fixed some issues building with VS2017 (#55) (@sobczyk)
    • fixed _Float16 erroneously detected as supported on g++ (#57) (@sobczyk)
    • fixed <Windows.h> causing compilation failure on mingw (#63) (@rezahousseini)
    • fixed CMake and pkg-config files not being installed into architecture-agnostic directories (#59) (@tambry)
    • fixed memory leak during parsing (#64) (@sneves)
    • fixed ambiguous operator== error on MSVC (#56) (@HellsingDarge)


    • added additional node_view constructors
    • added ability to specify serialization format of integer values
    • added integer value serialization format round trip (e.g. hex in, hex out)


    • updated conformance tests
    • TOML version bump to v1.0.0-rc.3
    • refactors and cleanups based on feedback given here

    Build system:

    • renamed build options to snake_case
    • tests, examples and cmake config now explicitly disabled when used as a subproject
    • removed small_binaries (it's now implicit when building as release)
    • bumped minimum meson version to 0.53
    Source code(tar.gz)
    Source code(zip)
  • v2.1.0(Aug 11, 2020)


    • fixed inconsistent emission of leading/trailing newlines when writing a table to an ostream (#48) (@levicki)
    • fixed Wcast-align warning spam on ARM
    • fixed array::insert not working correctly in some cases
    • fixed node::value_or() not having the same semantics as node::value() (#50) (@whiterabbit963)
    • fixed 'misleading assignment' of rvalue node_views (#52) (@Reedbeta)
    • fixed some issues handling infinities and NaNs (#51) (@Reedbeta)
    • fixed some minor documentation issues


    • added support for __fp16, _Float16, __float128, __int128_t and __uint128_t
    • added copy construction/assignment for arrays, tables and values
    • added insert, emplace, push_back etc. compatibility with node_views
    • added node::is_homogenous
    • added table::is_homogenous
    • added value::is_homogenous (just for generic code's sake)
    • added is_homogenous overload for identifying failure-causing element
    • added implicit conversion operator from node to node_view (#52) (@Reedbeta)


    • renamed TOML_ALL_INLINE to TOML_HEADER_ONLY (the old name will still work, but is no longer documented)
    • general cleanup
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(Jul 20, 2020)

    This release contains a fairly significant number of 'quality of life' improvements, yay! But also necessitates an ABI break (hence the version number bump). Changes that might block a migration are annotated with '⚠️'.


    • fixed infinity and NaN-related code breaking when using -ffast-math and friends
    • fixed narrowing conversion warnings when constructing int values from unsigned
    • fixed Visual Studio debugger native visualizations for date, time, time_offset, date_time
    • fixed some static assert messages being badly formatted on clang
    • fixed internal macro assert_or_assume leaking out of toml_parser.hpp


    • added additional types allowed in node::value() and node::value_or() (see value() dox for examples)
    • added additional types allowed in node_view::value() and node_view::value_or()
    • added node::value_exact() and node_view::value_exact()
    • added support for interop with wide strings on Windows:
      • added wide-string path arg overloads of parse() and parse_file()
      • added wide-string support to all relevant table and array ops
      • added wide-string support to node::value(), node::value_or()
      • added wide-string support to node_view::value(), node_view::value_or()
      • added wide-string support to value<string> constructor
      • added wide-string overloads of node_view::operator[]
      • added source_region::wide_path()
      • added TOML_WINDOWS_COMPAT switch for explicitly enabling/disabling this stuff
    • added emission of 'literal' strings to the TOML serializer
    • added lots of minor documentation fixes and improvements
    • added Visual Studio debugger native visualizations for table, array, parse_result, and parse_error (#46) (@Reedbeta)
    • added non-template version of array::is_homogeneous()
    • added explicit instantiations of more template types when !TOML_ALL_INLINE


    • improved the quality of many static_assert error messages
    • simplified internal ABI namespaces ⚠️

    Removals and Deprecations:

    • deprecated node_view::get() in favour of node_view::node() ⚠️
    • deprecated parse_result::get() in favour of parse_result::table() ⚠️
    • removed TOML_CHAR_8_STRINGS since it no longer makes sense ⚠️
    • renamed date_time::time_offset to just 'offset' ⚠️
    Source code(tar.gz)
    Source code(zip)
  • v1.3.3(Jun 29, 2020)


    • fixed some minor TOML spec conformance bugs
    • fixed BOM check causing EOF on very short iostream inputs
    • fixed std::numeric_limits::max() getting broken by macros in some environments
    • fixed 'unknown pragma' warning spam in older versions of GCC
    • fixed a few minor documentation issues


    • added rvalue overload of array::flatten
    • added conformance tests from BurntSushi/toml-test and iarna/toml-spec-tests
    • added toml::inserter as a workaround for nested construction of single-element toml::arrays performing move-construction instead
    • added license boilerplate to test files


    • refactored the parser to reduce binary size
    Source code(tar.gz)
    Source code(zip)
  • v.1.3.2(Jun 19, 2020)


    • fixed single-digit negative integers parsing as positive
    • fixed parse failure when parsing an empty file
    • fixed multi-line strings being allowed in keys
    • fixed overflow for very long binary integer literals


    • improved the performance of toml::parse_file
    • improved the performance of printing to streams for deepy-nested TOML data
    Source code(tar.gz)
    Source code(zip)
  • v1.3.0(Jun 2, 2020)


    • fixed formatter::print_inline() causing compilation failures in DLL builds
    • fixed BOMs occasionally causing overflow/crash in char8 mode
    • fixed some spurious warnings in GCC 10
    • fixed clang static analyzer warning in BOM handling code


    • added table_iterator::operator ->
    • added array::resize() and array::truncate()
    • added array::capacity(), array::shrink_to_fit(), array::max_size()
    • added non-const -> const conversion for table and array iterators


    • renamed table iterator proxy pair members to first and second to match STL
    Source code(tar.gz)
    Source code(zip)
  • v1.2.5(Apr 24, 2020)


    • fixed some multi-line string parsing issues
    • fixed pedantic warnings on gcc 10 and clang 11
    • fixed is_unicode_XXXXXX functions being wrong in some cases
    • fixed TOML_LIKELY not being correct on older versions of gcc and clang
    • fixed minor documentation issues (#26, #38) (@prince-chrismc)


    • added additional error message cases to the parser
    • added error_printer example
    • added toml_generator example


    • improved unicode-related codegen
    Source code(tar.gz)
    Source code(zip)
  • v1.2.3(Apr 11, 2020)


    • fixed printing of inf and nan
    • fixed parser not handling floats with leading '.' characters
    • fixed pedantic vtable warnings on clang with -Weverything
    • fixed a number of documentation bugs
    • fixed TOML_UNRELEASED_FEATURES default being 1 (it should have been 0)


    • added TOML_PARSER configuration option
    • added TOML_LIB_SINGLE_HEADER indicator
    • added doxygen page for the configuration options
    • added SPDX-License-Identifiers around the place


    • split some header files up to make future maintenance easier
    • refactored and greatly simplified parser
    Source code(tar.gz)
    Source code(zip)
  • v1.2.0(Apr 7, 2020)


    • fixed some parsing and printing ops being locale-dependent
    • fixed some parsing errors at EOF when TOML_EXCEPTIONS = 0
    • fixed some unreferenced variable warnings on older compilers
    • fixed some 'maybe-uninitialized' false-positives on GCC9
    • fixed pkgconfig subdir being wrong


    • added support for implementations without <charconv>
    • added cmake package config generator (#22) (@GiulioRomualdi)
    • added build config feature option GENERATE_CMAKE_CONFIG
    • added many new tests
    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Apr 3, 2020)


    • fixed some parser error paths not returning early enough TOML_EXCEPTIONS=0
    • fixed a number of minor documentation issues


    • added support for TOML 1.0.0-rc.1 🎉
    • added operator[], begin(), end() to toml::parse_result for TOML_EXCEPTIONS=0
    • added additional compilation speed improvements for TOML_ALL_INLINE=0
    • added more specific error messages for parsing errors relating to prohibited codepoints
    • added a large number of additional tests
    • added support for installation with meson (#16) (@ximion)
    • added the array and table iterators to the toml namespace
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Mar 28, 2020)

  • v0.6.0(Mar 24, 2020)


    • fixed minor preprocessor/macro issues
    • fixed minor documentation issues


    • added <cassert> include directly in 'debug' builds when TOML_ASSERT isn't defined
    • added Clang's [[trivial_abi]] attribute to date, time, time_offset
    Source code(tar.gz)
    Source code(zip)
  • v0.5.0(Mar 18, 2020)


    • fixed crash when reaching EOF while parsing a string when exceptions are disabled
    • fixed some attribute warnings in GCC
    • fixed build with GCC 8.2.0 (#15) (@shdnx)
    • fixed exception mode detection sometimes being incorrect on MSVC
    • fixed compilation on older implementations without std::launder
    • fixed json_formatter type deduction on older compilers


    • added support for Unicode 13.0
    • added support for \xHH escape sequences (toml/pull/796)
    • added short-form license preamble to all source files
    • added build configuration option for compiling examples
    Source code(tar.gz)
    Source code(zip)
  • v0.4.3(Mar 10, 2020)


    • fixed ICE in VS2019 when using /std:c++17 instead of `/std:c++latest


    • added #error when TOML_EXCEPTIONS is set to 1 but compiler exceptions were disabled


    • parsing performance improvements
    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Mar 5, 2020)


    • fixed parse_file() failing to compile with plain string literals
    • fixed tests being built when used as a meson subproject (#14) (@shdnx)


    • added support for compiling into DLLs on windows (TOML_API)
    • added support for explicitly setting the TOML_EXCEPTION mode
    • added TOML_OPTIONAL_TYPE customization point
    • added node::ref() and node_view::ref()
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Mar 1, 2020)


    • fixed some pedantic clang warnings
    • fixed some minor documentation errors


    • added node::value() and node::value_or()
    • added node_view::value()
    • added relops for the date/time classes
    • added preliminary support for ICC

    Removals and Deprecations:

    • removed <cmath> dependency
    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Feb 25, 2020)


    • fixed minor printing bug in operator << for source_position
    • fixed minor documentation issues


    • added operator<<(ostream&, parse_error)


    • improved quality of error messages for boolean and inf/nan parsing
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Feb 23, 2020)


    • fixed truncation of floating-point values when using ostreams
    • fixed missing value deduction guides for dates and times
    • fixed potential ODR issues relating to exception mode handling etc.
    • fixed some documentation issues


    • added serialization round-trip tests
    • added node::is_number()
    • added node_view::is_number()
    • added node_view::value_or()
    • added hexfloat parsing support for all implementations (not just <charconv> ones)
    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Feb 20, 2020)

Mark Gillard
Australian in Finland. I write code. Some of it is alright.
Mark Gillard
cpptoml is a header-only library for parsing TOML

cpptoml A header-only library for parsing TOML configuration files. Targets: TOML v0.5.0 as of August 2018. This includes support for the new DateTime

Chase Geigle 561 Dec 28, 2022
A general purpose data serializer.

GPDS is a General Purpose Data Serializer implemented as a very small C++ library. It allows to serialize C++ classes to and from XML files in a gener

Simulton 11 Dec 2, 2022
libcluon is a small and efficient, single-file and header-only library written in modern C++ to power microservices.

libcluon Linux & OSX Build (TravisCI) Win64 Build (AppVeyor) Test Coverage Coverity Analysis CII Best Practices libcluon is a small single-file, heade

Christian Berger 81 Nov 30, 2022
Header-only C++11 library to encode/decode base64, base64url, base32, base32hex and hex (a.k.a. base16) as specified in RFC 4648, plus Crockford's base32. MIT licensed with consistent, flexible API.

cppcodec Header-only C++11 library to encode/decode base64, base64url, base32, base32hex and hex (a.k.a. base16) as specified in RFC 4648, plus Crockf

Topology 491 Dec 28, 2022
Zmeya is a header-only C++11 binary serialization library designed for games and performance-critical applications

Zmeya Zmeya is a header-only C++11 binary serialization library designed for games and performance-critical applications. Zmeya is not even a serializ

Sergey Makeev 99 Dec 24, 2022
Header-only library for automatic (de)serialization of C++ types to/from JSON.

fuser 1-file header-only library for automatic (de)serialization of C++ types to/from JSON. how it works The library has a predefined set of (de)seria

null 51 Dec 17, 2022
A YAML parser and emitter in C++

yaml-cpp yaml-cpp is a YAML parser and emitter in C++ matching the YAML 1.2 spec. To get a feel for how it can be used, see the Tutorial or How to Emi

Jesse Beder 3.8k Jan 1, 2023
Utility to convert any binary file into C source that can be compiled and linked to the executable.

bin2c Utility to convert any binary file into C source that can be compiled and linked to the executable. bin2o Utility to convert any binary file int

Vadim A. Anisimov 16 Jul 14, 2021
Use to copy a file from an NTFS partitioned volume by reading the raw volume and parsing the NTFS structures.

ntfsDump Use to copy a file from an NTFS partitioned volume by reading the raw volume and parsing the NTFS structures. Similar to https://github.com/P

null 102 Dec 30, 2022
BRAW decoder to allow unattended, headless, conversion of *.braw files into other file formats.

BRAW Decode This is a project that uses the official Blackmagic Raw SDK to decode a *.braw file in a way that can be read by FFmpeg. The goal of the p

Shelby Jueden 11 Oct 5, 2022
A C++11 or library for parsing and serializing JSON to and from a DOM container in memory.

Branch master develop Azure Docs Drone Matrix Fuzzing --- Appveyor codecov.io Boost.JSON Overview Boost.JSON is a portable C++ library which provides

Boost.org 333 Dec 29, 2022
Microsoft 2.5k Dec 31, 2022
Cap'n Proto serialization/RPC system - core tools and C++ library

Cap'n Proto is an insanely fast data interchange format and capability-based RPC system. Think JSON, except binary. Or think Protocol Buffers, except

Cap'n Proto 9.5k Jan 1, 2023
Fast Binary Encoding is ultra fast and universal serialization solution for C++, C#, Go, Java, JavaScript, Kotlin, Python, Ruby, Swift

Fast Binary Encoding (FBE) Fast Binary Encoding allows to describe any domain models, business objects, complex data structures, client/server request

Ivan Shynkarenka 654 Jan 2, 2023
MessagePack implementation for C and C++ / msgpack.org[C/C++]

msgpack for C/C++ It's like JSON but smaller and faster. Overview MessagePack is an efficient binary serialization format, which lets you exchange dat

MessagePack 2.6k Dec 31, 2022
FlatBuffers Compiler and Library in C for C

OS-X & Ubuntu: Windows: The JSON parser may change the interface for parsing union vectors in a future release which requires code generation to match

null 550 Dec 25, 2022
Experimental mutation testing tool for Swift and XCTest powered by mull

mull-xctest Experimental mutation testing tool for Swift and XCTest powered by mull. ⚠️ This tool is still experimental and under development. Install

Yuta Saito 43 Dec 14, 2022
A C++11 ASN.1 BER Encoding and Decoding Library

fast_ber A performant ASN.1 BER encoding and decoding library written in C++11 Introduction fast_ber is a small, lightweight library for BER encoding

null 73 Dec 21, 2022