2. What is the output of the following C++ program?

#include <algorithm>
#include <iostream>
#include <iterator>
#include <memory>
#include <utility>

typedef std::unique_ptr<int> P;

struct is_null
{
    bool operator()(const P &p) const
    {
        return !bool(p);
    }
};

int main()
{
    P p[] = { P(new int(1)), P(new int(0)), P(nullptr), P(new int(2)), P() };
    auto b = std::begin(p);
    auto e = std::end(p);

    std::cout << std::count_if(b, e, is_null());

    P x = std::move(p[0]);
    P &y = p[1];
    static_cast<void>(y);
    p[2] = std::move(p[3]);

    std::cout << std::count_if(b, e, is_null()) << std::endl;

    return 0;
}