#include <functional>
#include <string>
#include <iostream>

struct Guy ;

struct Girl
{
    Girl( Guy& g ) : boyfriend(g) {}
    std::reference_wrapper<Guy> boyfriend ;
};

struct Guy
{
    const std::string name ;
  // ...
};

int main()
{
    Guy a { "a" };

    Girl b(a) ;
    std::cout << b.boyfriend.get().name << '\n' ;

    Guy c { "c" } ;
    b.boyfriend = c ;
    std::cout << b.boyfriend.get().name << '\n' ;

    Guy no_one { "no one" };
    b.boyfriend = no_one ;
    std::cout << b.boyfriend.get().name << '\n' ;
}
