#include <memory>
#include <iostream>
#include <cstring>

using namespace std;

char *returnsastring() { return strdup("fish"); }
char *returnsnull()    { return NULL; }

int main()
{
	auto_ptr<char> string(returnsastring());
	auto_ptr<char> null(returnsnull());

	// Have to use .get().  Direct comparison yields
	// error: no match for 'operator==' in 'string == 0'
	if (string.get() == NULL) {
		cout << "hua?" << endl;
	}

	if (null.get() == NULL) {
		cout << "NULL where expected." << endl;
	}

	return 0;
}

