Skip to content

Commit

Permalink
fix move ctor for SandwichDB
Browse files Browse the repository at this point in the history
Expose and fix github issue #14
  • Loading branch information
Nikolay Orliuk committed Nov 3, 2014
1 parent 1f3a76d commit 54403c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/leveldb/sandwich_db.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ namespace leveldb
Sequence<Prefix> seq { meta, Slice() };

public:
SandwichDB(SandwichDB<Base,Prefix> &&) = default;
SandwichDB(SandwichDB<Base,Prefix> &&orig) :
base(std::move(orig.base))
{}

template <typename... Args>
SandwichDB(Args &&... args) : base(std::forward<Args>(args)...)
Expand Down
6 changes: 6 additions & 0 deletions test/simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,12 @@ TEST(Simple, host_order)
EXPECT_EQ( "\x42\x44", leveldb::Slice(x) );
}

TEST(Simple, sandwich_move_issue14)
{
auto db = std::move(leveldb::SandwichDB<leveldb::MemoryDB> {});
(void) db.use("alpha");
}

TEST(Simple, sandwich)
{
leveldb::SandwichDB<leveldb::MemoryDB> sdb;
Expand Down

0 comments on commit 54403c6

Please sign in to comment.