Modify

Ticket #6183 (closed Bugs: fixed)

Opened 2 years ago

Last modified 2 years ago

[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

Change History

comment:1 Changed 2 years ago by igaztanaga

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

Thanks fixed in trunk at revision: 76115

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
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.