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

@@ -112,6 +112,10 @@ namespace sr
return m_deleter;
}

Deleter& get_deleter() noexcept
{
return m_deleter;
}

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

+ 1
- 0
test/UniqueResourceTest.cpp View File

@@ -305,3 +305,4 @@ TEST_CASE("deleter access", "[UniqueResource]")
guard.get_deleter()(6);
REQUIRE(value == 6);
}


Loading…
Cancel
Save