Opened 11 years ago

Closed 11 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);
}

Change History (1)

comment:1 by Ion Gaztañaga, 11 years ago

Resolution: fixed
Status: newclosed

Thanks fixed in trunk at revision: 76115

Note: See TracTickets for help on using tickets.