| 172 | */ |
| 173 | template<class T> |
| 174 | auto |
| 175 | pilfer(T&& t) noexcept -> |
| 176 | typename std::conditional< |
| 177 | std::is_nothrow_constructible< |
| 178 | typename std::remove_reference<T>::type, |
| 179 | pilfered<typename |
| 180 | std::remove_reference<T>::type> >::value && |
| 181 | ! std::is_nothrow_constructible< |
| 182 | typename std::remove_reference<T>::type, |
| 183 | detail_pilfer::not_pilfered<typename |
| 184 | std::remove_reference<T>::type> >::value, |
| 185 | pilfered<typename std::remove_reference<T>::type>, |
| 186 | typename std::remove_reference<T>::type&& |
| 187 | >::type |
| 188 | { |
| 189 | using U = |
| 190 | typename std::remove_reference<T>::type; |
| 191 | BOOST_CORE_STATIC_ASSERT( is_pilfer_constructible<U>::value ); |
| 192 | return typename std::conditional< |
| 193 | std::is_nothrow_constructible< |
| 194 | U, pilfered<U> >::value && |
| 195 | ! std::is_nothrow_constructible< |
| 196 | U, detail_pilfer::not_pilfered<U> >::value, |
| 197 | pilfered<U>, U&& |
| 198 | >::type(std::move(t)); |
| 199 | } |
| 200 | |
| 201 | /* |
| 202 | template<class T> |
no outgoing calls
no test coverage detected