Subject: [Boost-bugs] [Boost C++ Libraries] #6183: [move][doc] missing return type
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-11-29 09:30:26
#6183: [move][doc] missing return type
-------------------------------------------------------+--------------------
Reporter: Akira Takahashi <faithandbrave@â¦> | Owner: igaztanaga
Type: Bugs | Status: new
Milestone: To Be Determined | Component: move
Version: Boost 1.48.0 | Severity: Problem
Keywords: |
-------------------------------------------------------+--------------------
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);
}
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6183> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC