• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2018-2021 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 <boost/pfr/ops.hpp>
7 
8 #include <string>
9 
10 #if defined(_MSC_VER)
11 # pragma warning( disable: 4624 ) // destructor was implicitly defined as deleted
12 #endif
13 
14 union test_unrestricted_union {
15     int i;
16     std::string s;
17 };
18 
main()19 int main() {
20     struct two_unions {
21         test_unrestricted_union u1, u2;
22     };
23 
24     // Not calling the destructor intentionally!
25     auto v = new two_unions{{1}, {1}};
26 
27     return boost::pfr::eq(*v, *v);
28 }
29