Modify

Opened 6 years ago

Closed 6 years ago

#6183 closed Bugs (fixed)

[move][doc] missing return type

Reported by: Akira Takahashi <faithandbrave@…> Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: move
Version: Boost 1.48.0 Severity: Problem
Keywords: Cc:

Description

this code in introduction document:

template <class T> swap(T& a, T& b)
{
   T tmp(a);   // now we have two copies of a
   a = b;      // now we have two copies of b
   b = tmp;    // now we have two copies of tmp (aka a)
}
template <class T> swap(T& a, T& b)
{
   T tmp(::boost::move(a));
   a = ::boost::move(b);
   b = ::boost::move(tmp);
}

http://www.boost.org/doc/libs/1_48_0/doc/html/move/introduction.html

it seem missing return type(void). should be:

template <class T> void swap(T& a, T& b)
{
   T tmp(a);   // now we have two copies of a
   a = b;      // now we have two copies of b
   b = tmp;    // now we have two copies of tmp (aka a)
}
template <class T> void swap(T& a, T& b)
{
   T tmp(::boost::move(a));
   a = ::boost::move(b);
   b = ::boost::move(tmp);
}

Attachments (0)

Change History (1)

comment:1 Changed 6 years ago by Ion Gaztañaga

Resolution: fixed
Status: newclosed

Thanks fixed in trunk at revision: 76115

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ion Gaztañaga.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.