...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::scope::make_unique_resource_checked — Checks if the resource is valid and creates a unique_resource
wrapper.
// In header: <boost/scope/unique_resource.hpp> template<typename Resource, typename Deleter, typename Invalid = typename std::decay< Resource >::type> unique_resource< typename std::decay< Resource >::type, typename std::decay< Deleter >::type > make_unique_resource_checked(Resource && res, Invalid const & invalid, Deleter && del);
Effects: If the resource res is not equal to invalid, creates a unique resource wrapper that is in allocated state and owns res. Otherwise creates a unique resource wrapper in unallocated state.
Note | |
---|---|
This function does not call del if res is equal to invalid. |
Throws: Nothing, unless
constructor throws.unique_resource
Parameters: |
|