mirror of
https://github.com/shadps4-emu/ext-fmt.git
synced 2024-11-23 09:49:42 +00:00
parent
6725225750
commit
13038f37e8
@ -1476,6 +1476,12 @@ template <typename Context> struct arg_mapper {
|
||||
|
||||
FMT_MAP_API auto map(void* val) -> const void* { return val; }
|
||||
FMT_MAP_API auto map(const void* val) -> const void* { return val; }
|
||||
FMT_MAP_API auto map(volatile void* val) -> const void* {
|
||||
return const_cast<const void*>(val);
|
||||
}
|
||||
FMT_MAP_API auto map(const volatile void* val) -> const void* {
|
||||
return const_cast<const void*>(val);
|
||||
}
|
||||
FMT_MAP_API auto map(std::nullptr_t val) -> const void* { return val; }
|
||||
|
||||
// Use SFINAE instead of a const T* parameter to avoid a conflict with the
|
||||
|
@ -425,6 +425,14 @@ TEST(arg_test, pointer_arg) {
|
||||
CHECK_ARG_SIMPLE(cp);
|
||||
}
|
||||
|
||||
TEST(arg_test, volatile_pointer_arg) {
|
||||
const void* p = nullptr;
|
||||
volatile int* vip = nullptr;
|
||||
const volatile int* cvip = nullptr;
|
||||
CHECK_ARG(char, p, static_cast<volatile void*>(vip));
|
||||
CHECK_ARG(char, p, static_cast<const volatile void*>(cvip));
|
||||
}
|
||||
|
||||
struct check_custom {
|
||||
auto operator()(fmt::basic_format_arg<fmt::format_context>::handle h) const
|
||||
-> test_result {
|
||||
|
Loading…
Reference in New Issue
Block a user