2
0
mirror of https://github.com/boostorg/pfr.git synced 2026-02-01 20:52:11 +00:00
Files
pfr/test/core/cpp26_reflection_detection.cpp
Antony Polukhin 25b5fd744d tweaks
2026-01-31 12:59:34 +03:00

34 lines
663 B
C++

// Copyright (c) 2025-2026 Antony Polukhin
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// Detection of variadic structured binding support
#include <type_traits>
#include <version>
#ifndef __cpp_lib_reflection
#error Compiler does not support the required features
#endif
struct MyPair {
int first;
int second;
};
template <class T>
auto test() {
return T{}.[:
nonstatic_data_members_of(
^^T,
std::meta::access_context::current()
).at(0)
:];
}
int main() {
return ::test<MyPair>();
}