Updated examples to use unique_ptr when available rather than auto_ptr, which is being deprecated.

This commit is contained in:
Edward Diener 2017-08-26 15:04:47 -04:00
parent a72deda3ac
commit 3275ee3c82
3 changed files with 30 additions and 0 deletions

View File

@ -11,7 +11,17 @@
int main()
{
#if defined(BOOST_NO_CXX11_SMART_PTR)
std::auto_ptr<node<int> > nodes(new node<int>(42));
#else
std::unique_ptr<node<int> > nodes(new node<int>(42));
#endif
nodes->append(new node<std::string>(" is greater than "));
nodes->append(new node<int>(13));

View File

@ -12,7 +12,17 @@
int main()
{
#if defined(BOOST_NO_CXX11_SMART_PTR)
std::auto_ptr<node<int> > nodes(new node<int>(42));
#else
std::unique_ptr<node<int> > nodes(new node<int>(42));
#endif
nodes->append(new node<std::string>(" is greater than "));
nodes->append(new node<int>(13));

View File

@ -12,7 +12,17 @@
int main()
{
#if defined(BOOST_NO_CXX11_SMART_PTR)
std::auto_ptr<node<int> > nodes(new node<int>(42));
#else
std::unique_ptr<node<int> > nodes(new node<int>(42));
#endif
nodes->append(new node<std::string>(" is greater than "));
nodes->append(new node<int>(13));