diff options
| author | Mike Aizatsky <maizatskyi@cloudflare.com> | 2026-11-20 10:19:04 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-20 10:19:04 -0800 |
| commit | d10fc880af2a5899d83a34afddea195b2ce8525c (patch) | |
| tree | 0b33898b7489a80d13c1fe5c79b20d214e01a826 /c++/src/kj/tuple.h | |
| parent | 7d3db3760068ec6a5214a0c3509da398e71dc668 (diff) | |
| download | capnproto-master.tar.gz capnproto-master.zip | |
fix head windows builds (#2937)HEADlocal/capnprotomaster
* fix msvc-latest build
* update bazel-windows build
Diffstat (limited to 'c++/src/kj/tuple.h')
| -rw-r--r-- | c++/src/kj/tuple.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/c++/src/kj/tuple.h b/c++/src/kj/tuple.h index 77da07bf..f32a4340 100644 --- a/c++/src/kj/tuple.h +++ b/c++/src/kj/tuple.h @@ -115,7 +115,15 @@ struct TupleElement { constexpr inline TupleElement(U&& value): value(pointerSafeSource<T>(kj::fwd<U>(value))) {} }; +#if !defined(_MSC_VER) || defined(__clang__) +// MSVC rejects __reference_constructs_from_temporary as an argument to __has_builtin (C1017), so +// the check must not be evaluated there. #if __has_builtin(__reference_constructs_from_temporary) +#define KJ_HAS_REFERENCE_CONSTRUCTS_FROM_TEMPORARY 1 +#endif +#endif + +#if KJ_HAS_REFERENCE_CONSTRUCTS_FROM_TEMPORARY template <typename T, typename U> concept BindsTemporary = __reference_constructs_from_temporary(T, U&&); #else @@ -123,7 +131,7 @@ template <typename T, typename U> concept BindsTemporary = false; #endif // Concept: T is a reference that, initialized from U&&, would bind to a temporary. Compilers -// without the builtin do not detect this case. +// without the builtin (including MSVC) do not detect this case. template <typename T, typename U> concept TupleElementConstructibleFrom = PointerSafeConstructibleFrom<T, U> && |
