Why are you trying to assign nullptr to name? Name is a string not a pointer and only a pointer can be assigned to a nullptr.
You seem to be using a fairly recent compiler so I would recommend something more like:
Code:
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class person
{
private:
std::string name;
std::vector<person> friends;
public:
person() = default; // Let the compiler handle the default constructor.
person(std::string name, std::vector<person> friendlist) : name(name), friends(friendlist) {};
};
int main()
{
person p1; // No need for any brackets or parentheses.
person p2;
vector<person> v{ p1, p2 };
person p3{"Tom", v}; // You used brackets above, so stay consistent use brackets here also.
}