## Function template make_unique_resource_checked

boost::scope::make_unique_resource_checked — Checks if the resource is valid and creates a `unique_resource` wrapper.

## Synopsis

    // 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);

## Description

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 `unique_resource` constructor throws.

Parameters: |
`res` | Resource to wrap.
`invalid` | An invalid value for the resource.
`del` | A deleter to invoke on the resource to free it.