version 3.8
format.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3//
4// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
18#ifndef DUMUX_IO_FORMAT_HH
19#define DUMUX_IO_FORMAT_HH
20
21#if __has_include(<format>) // cppcheck-suppress preprocessorErrorDirective
22#include <format>
23#endif
24
25#include <dumux/io/format/fmt/format.h>
26#include <dumux/io/format/fmt/ranges.h>
27
29namespace Dumux::Fmt {
30
31#if __cpp_lib_format
32// use std::format from C++20
33using std::format;
34using std::format_to;
35using std::format_to_n;
36using std::formatted_size;
37using std::vformat;
38using std::vformat_to;
39using std::make_format_args;
40#else
41// use fallback fmt library
42using Dumux::Detail::fmt::format;
43using Dumux::Detail::fmt::format_to;
44using Dumux::Detail::fmt::format_to_n;
45using Dumux::Detail::fmt::formatted_size;
46using Dumux::Detail::fmt::vformat;
47using Dumux::Detail::fmt::vformat_to;
48using Dumux::Detail::fmt::make_format_args;
49#endif
50
51} // end namespace Dumux::Fmt
52
53#endif
Formatting tools in the style of std::format (C++20)
Definition: format.hh:29