Kaynağa Gözat

Factory functions can use the ctor directly now.

main
offa 7 yıl önce
ebeveyn
işleme
ae68d0abca
4 değiştirilmiş dosya ile 5 ekleme ve 5 silme
  1. +1
    -1
      include/scope_exit.h
  2. +1
    -1
      include/scope_fail.h
  3. +1
    -1
      include/scope_success.h
  4. +2
    -2
      include/unique_resource.h

+ 1
- 1
include/scope_exit.h Dosyayı Görüntüle

@@ -60,7 +60,7 @@ namespace sr
[[deprecated("Use ctor instead. Will be removed in a future v0.2.x release")]]
scope_exit<std::decay_t<EF>> make_scope_exit(EF&& exitFunction)
{
return scope_exit<std::decay_t<EF>>{std::forward<EF>(exitFunction)};
return scope_exit{std::forward<EF>(exitFunction)};
}

}

+ 1
- 1
include/scope_fail.h Dosyayı Görüntüle

@@ -70,7 +70,7 @@ namespace sr
[[deprecated("Use ctor instead. Will be removed in a future v0.2.x release")]]
scope_fail<std::decay_t<EF>> make_scope_fail(EF&& exitFunction)
{
return scope_fail<std::decay_t<EF>>{std::forward<EF>(exitFunction)};
return scope_fail{std::forward<EF>(exitFunction)};
}

}

+ 1
- 1
include/scope_success.h Dosyayı Görüntüle

@@ -63,7 +63,7 @@ namespace sr
[[deprecated("Use ctor instead. Will be removed in a future v0.2.x release")]]
scope_success<std::decay_t<EF>> make_scope_success(EF&& exitFunction)
{
return scope_success<std::decay_t<EF>>{std::forward<EF>(exitFunction)};
return scope_success{std::forward<EF>(exitFunction)};
}

}

+ 2
- 2
include/unique_resource.h Dosyayı Görüntüle

@@ -213,7 +213,7 @@ namespace sr
noexcept(std::is_nothrow_constructible_v<std::decay_t<R>, R>
&& std::is_nothrow_constructible_v<std::decay_t<D>, D>)
{
return unique_resource<std::decay_t<R>, std::decay_t<D>>{std::forward<R>(r), std::forward<D>(d)};
return unique_resource{std::forward<R>(r), std::forward<D>(d)};
}

template<class R, class D>
@@ -221,7 +221,7 @@ namespace sr
unique_resource<R&, std::decay_t<D>> make_unique_resource(std::reference_wrapper<R> r, D d)
noexcept(std::is_nothrow_constructible_v<std::decay_t<D>, D>)
{
return unique_resource<R&, std::decay_t<D>>{r.get(), std::forward<D>(d)};
return unique_resource{r.get(), std::forward<D>(d)};
}

template<class R, class D, class S = R>

Yükleniyor…
İptal
Kaydet