浏览代码

Helper function implemented.

main
offa 7 年前
父节点
当前提交
831c97cc89
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. +12
    -0
      include/unique_resource.h

+ 12
- 0
include/unique_resource.h 查看文件

@@ -35,6 +35,18 @@ namespace sr
constexpr auto is_nothrow_move_or_copy_constructible_from_v = is_ntmocp_constructible<T, TT>::value;


template<class T,
class U = std::conditional_t<(!std::is_nothrow_move_assignable<T>::value
&& std::is_copy_assignable<T>::value),
T const &,
T &&>>
constexpr U move_assign_if_noexcept(T&& value) noexcept
{
return std::move(value);
}



template<class R, class D>
class unique_resource
{

正在加载...
取消
保存