Skip to content

Commit e89a07a

Browse files
committed
chore: define FMT_CONSTEVAL
1 parent f6c5346 commit e89a07a

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

include/mrdox/Platform.hpp

+4
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ namespace mrdox {
7878
# endif
7979
#endif
8080

81+
#if ! defined(__GNUC__) && defined(_MSC_VER)
82+
#define FMT_CONSTEVAL
83+
#endif
84+
8185
} // mrdox
8286
} // clang
8387

include/mrdox/Support/Format.hpp

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
//
2+
// Licensed under the Apache License v2.0 with LLVM Exceptions.
3+
// See https://llvm.org/LICENSE.txt for license information.
4+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5+
//
6+
// Copyright (c) 2023 Vinnie Falco ([email protected])
7+
//
8+
// Official repository: https://github.com/cppalliance/mrdox
9+
//
10+
11+
#ifndef MRDOX_API_SUPPORT_FORMAT_HPP
12+
#define MRDOX_API_SUPPORT_FORMAT_HPP
13+
14+
#include <mrdox/Platform.hpp>
15+
#include <fmt/format.h>
16+
#include <source_location>
17+
18+
namespace clang {
19+
namespace mrdox {
20+
21+
template<class... Args>
22+
struct FormatString
23+
{
24+
template<class T>
25+
FormatString(
26+
T const& fs_,
27+
std::source_location loc_ =
28+
std::source_location::current())
29+
: fs(fs_)
30+
, loc(loc_)
31+
{
32+
static_assert(std::is_constructible_v<
33+
std::string_view, T const&>);
34+
}
35+
36+
std::string_view fs;
37+
std::source_location loc;
38+
};
39+
40+
} // mrdox
41+
} // clang
42+
43+
#endif

0 commit comments

Comments
 (0)