repr 0.1
Reconstructable string representations and more
Loading...
Searching...
No Matches
format.h
Go to the documentation of this file.
1#pragma once
2#include <librepr/feature.h>
3#include "util.h"
4
5#ifndef REPR_FORMAT_FMT
6#define REPR_FORMAT_FMT OFF
7#endif
8
9#if !__has_include(<format>) || __has_include(<fmt/format.h>)
10#undef REPR_FORMAT_FMT
11#define REPR_FORMAT_FMT ON
12#endif
13
14#if USING(REPR_FORMAT_FMT)
15#include <fmt/format.h>
16#define REPR_FORMAT_RNS fmt
17#else
18#include <format>
19#define REPR_FORMAT_RNS std
20#endif
21
22#define REPR_FORMAT_NS ::REPR_FORMAT_RNS
23#define REPR_FORMAT(...) ::REPR_FORMAT_RNS::format(__VA_ARGS__)