I don't know what can I do to make this work in C++.

The intend is:

```
pair<int, int> foo() {
  if(cond) {
    return std::make_pair(1,2);
  }
  return NULL; //error: no viable conversion from 'long' to 'pair<int, int>
}
void boo() {
  pair<int, int> p = foo();
  if (p == NULL) { //error: comparison between NULL and non-pointer ('int, int' and NULL)
    // doA
  } else {
    int a = p.first;
    int b = p.second;
    // doB
  }
}

```

Since I cannot use return NULL in C++, here is my 2nd try:

```
pair<int, int>* foo() {
  if(cond) {
    return &std::make_pair(1,2); //error: returning address of local temporary object)
  }
  return nullptr;
}
void boo() {
  pair<int, int>* p = foo();
  if (p == nullptr) {
    // doA
  } else {
    int a = p->first;
    int b = p->second;
    // doB
  }
}

```

What is the correct way to be able to return a pair and a null value.