Modify ↓

Opened 6 years ago

Closed 6 years ago

## #6183 closed Bugs (fixed)

# [move][doc] missing return type

Reported by: | 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)

**Note:**See TracTickets for help on using tickets.

Thanks fixed in trunk at revision: 76115