MCPcopy Create free account
hub / github.com/boostorg/json / pilfer

Function pilfer

include/boost/json/pilfer.hpp:174–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172*/
173template<class T>
174auto
175pilfer(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/*
202template<class T>

Callers 9

testSpecialMethod · 0.85
testCtorsMethod · 0.85
testConstructionMethod · 0.85
testCtorsMethod · 0.85
key_value_pairMethod · 0.85
emplaceMethod · 0.85
array.hppFile · 0.85
insertMethod · 0.85
emplace_implMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected