Browse Source

Non-const deleter accessor implemented.

main
offa 7 years ago
parent
commit
c4d4e5820e
2 changed files with 5 additions and 0 deletions
  1. +4
    -0
      include/unique_resource.h
  2. +1
    -0
      test/UniqueResourceTest.cpp

+ 4
- 0
include/unique_resource.h View File

return m_deleter; return m_deleter;
} }


Deleter& get_deleter() noexcept
{
return m_deleter;
}


unique_resource_t& operator=(unique_resource_t&& other) noexcept unique_resource_t& operator=(unique_resource_t&& other) noexcept
{ {

+ 1
- 0
test/UniqueResourceTest.cpp View File

guard.get_deleter()(6); guard.get_deleter()(6);
REQUIRE(value == 6); REQUIRE(value == 6);
} }


Loading…
Cancel
Save