Преглед изворни кода

Implementation of make_unique_resource_checked() updated to match the

specification (#152).
main
offa пре 6 година
родитељ
комит
877ffdea3c
1 измењених фајлова са 1 додато и 2 уклоњено
  1. +1
    -2
      include/unique_resource.h

+ 1
- 2
include/unique_resource.h Прегледај датотеку

noexcept(std::is_nothrow_constructible_v<std::decay_t<R>, R> noexcept(std::is_nothrow_constructible_v<std::decay_t<R>, R>
&& std::is_nothrow_constructible_v<std::decay_t<D>, D>) && std::is_nothrow_constructible_v<std::decay_t<D>, D>)
{ {
const bool must_release{r == invalid};
unique_resource<std::decay_t<R>, std::decay_t<D>> ur{std::forward<R>(r), std::forward<D>(d)}; unique_resource<std::decay_t<R>, std::decay_t<D>> ur{std::forward<R>(r), std::forward<D>(d)};


if( must_release == true )
if( bool(r == invalid) == true )
{ {
ur.release(); ur.release();
} }

Loading…
Откажи
Сачувај