mirror of
https://github.com/boostorg/iterator.git
synced 2025-05-11 13:33:56 +00:00
Updated examples to use unique_ptr when available rather than auto_ptr, which is being deprecated.
This commit is contained in:
parent
a72deda3ac
commit
3275ee3c82
@ -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));
|
||||
|
||||
|
@ -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));
|
||||
|
||||
|
@ -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));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user