1// Copyright (c) 2018-2024 Antony Polukhin
2//
3// Distributed under the Boost Software License, Version 1.0. (See accompanying
4// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6#include <string>
7
8#include <boost/pfr/ops.hpp>
9
10union test_union {
11 const char* c;
12 int i;
13};
14
15int main() {
16 struct two_unions {
17 test_union u1, u2;
18 };
19
20 two_unions v{.u1: {.c: ""}, .u2: {.c: ""}};
21 return boost::pfr::eq(lhs: v, rhs: v);
22}
23

source code of boost/libs/pfr/test/core/compile-fail/ops_unions.cpp