Skip to content

Commit 01ae579

Browse files
committed
test: add utilty header is_permissive.hpp
1 parent 3cc14f5 commit 01ae579

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

tests/third_party/msvc/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
include_directories(SYSTEM "include")
2+
13
add_subdirectory(msvc_stl_p0323r12_test)
24
if (MSVC_TOOLSET_VERSION GREATER_EQUAL 143)
35
# can only built with v143 and later
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3+
4+
#pragma once
5+
6+
#include <yvals_core.h>
7+
8+
namespace detail {
9+
constexpr bool permissive() {
10+
return false;
11+
}
12+
13+
template <class>
14+
struct PermissiveTestBase {
15+
static constexpr bool permissive() {
16+
return true;
17+
}
18+
};
19+
20+
template <class T>
21+
struct PermissiveTest : PermissiveTestBase<T> {
22+
static constexpr bool test() {
23+
return permissive();
24+
}
25+
};
26+
} // namespace detail
27+
28+
template <class T>
29+
constexpr bool is_permissive_v = detail::PermissiveTest<T>::test();
30+
31+
_INLINE_VAR constexpr bool is_permissive = is_permissive_v<int>;

0 commit comments

Comments
 (0)