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: igaztanaga
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 igaztanaga

  • Resolution set to fixed
  • Status changed from new to closed

Thanks fixed in trunk at revision: 76115

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain igaztanaga.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.