aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/file-cache.ixx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/file-cache.ixx')
-rw-r--r--libbuild2/file-cache.ixx24
1 files changed, 17 insertions, 7 deletions
diff --git a/libbuild2/file-cache.ixx b/libbuild2/file-cache.ixx
index 8385c90..99be5ad 100644
--- a/libbuild2/file-cache.ixx
+++ b/libbuild2/file-cache.ixx
@@ -65,26 +65,30 @@ namespace build2
}
inline file_cache::entry::
- entry (entry&& e)
+ entry (entry&& e) noexcept
: temporary (e.temporary),
state_ (e.state_),
path_ (move (e.path_)),
comp_path_ (move (e.comp_path_)),
pin_ (e.pin_)
{
+ e.state_ = null;
}
inline file_cache::entry& file_cache::entry::
- operator= (entry&& e)
+ operator= (entry&& e) noexcept
{
if (this != &e)
{
assert (state_ == null);
+
temporary = e.temporary;
state_ = e.state_;
path_ = move (e.path_);
comp_path_ = move (e.comp_path_);
pin_ = e.pin_;
+
+ e.state_ = null;
}
return *this;
}
@@ -105,14 +109,14 @@ namespace build2
}
inline file_cache::write::
- write (write&& e)
+ write (write&& e) noexcept
: entry_ (e.entry_)
{
e.entry_ = nullptr;
}
inline file_cache::write& file_cache::write::
- operator= (write&& e)
+ operator= (write&& e) noexcept
{
if (this != &e)
{
@@ -132,14 +136,14 @@ namespace build2
}
inline file_cache::read::
- read (read&& e)
+ read (read&& e) noexcept
: entry_ (e.entry_)
{
e.entry_ = nullptr;
}
inline file_cache::read& file_cache::read::
- operator= (read&& e)
+ operator= (read&& e) noexcept
{
if (this != &e)
{
@@ -173,9 +177,15 @@ namespace build2
: string ();
}
+ inline void file_cache::
+ init (bool compress)
+ {
+ compress_ = compress;
+ }
+
inline file_cache::
file_cache (bool compress)
- : compress_ (compress)
{
+ init (compress);
}
}