#include <iostream>
struct Bar;
struct Foo
{
    Bar& refBar;
    int n;
    void show() const;
};

struct Bar
{
    Foo& refFoo;
    int n;
    void show() const;
};

void Foo::show() const
{
    std::cout << "Foo.n is " << n
              << " Foo.refBar.n is " << refBar.n
              << '\n';
}

void Bar::show() const
{
     std::cout << "Bar.n is " << n
               << " Bar.refFoo.n is " << refFoo.n
               << '\n';
}

int main()
{
    struct {Foo f; Bar b;} s = {{s.b, 2}, {s.f, 1}};
    s.f.show();
    s.b.show();
}
