浏览代码

Missing reset() method added.

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

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

#include "scope_exit.h" #include "scope_exit.h"
#include <utility> #include <utility>
#include <type_traits> #include <type_traits>
#include <functional>


namespace sr namespace sr
{ {
return m_value.get(); return m_value.get();
} }


void reset(T& newValue) noexcept
{
m_value = std::ref(newValue);
}



private: private:



正在加载...
取消
保存