Просмотр исходного кода

Missing reset() method added.

main
offa 7 лет назад
Родитель
Сommit
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:



Загрузка…
Отмена
Сохранить