#ifndef TEST_INTEROP_CXX_CLASS_STRUCTURED_BINDINGS_H #define TEST_INTEROP_CXX_CLASS_STRUCTURED_BINDINGS_H namespace std { template struct pear { pear(X x, Y y) {} X getX() const { return 0; } Y getY() const { return 42; } }; template struct tuple_size { constexpr static const int value = 2; }; template struct tuple_element { }; template struct tuple_element<0, pear> { using type = X; }; template struct tuple_element<1, pear> { using type = Y; }; template inline typename tuple_element>::type get(const pear & value) { if constexpr (N == 0) { return value.getX(); } else { return value.getY(); } } } // namespace std inline int testDestructure(int x) { auto val = std::pear( x, x + 2 ); auto [y,z] = val; return z; } #endif // TEST_INTEROP_CXX_CLASS_STRUCTURED_BINDINGS_H