mirror of
https://github.com/latentPrion/libspinscale.git
synced 2026-08-12 15:42:10 +00:00
SharedResourceGroup: add move constructor for initial resource.
Allows move-only ResourceType values (e.g. containers of unique_ptr) to initialize rsrc without copying. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define SHARED_RESOURCE_GROUP_H
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
namespace sscl {
|
||||
|
||||
@@ -20,6 +21,11 @@ public:
|
||||
: lock(lockName), rsrc(initialRsrc)
|
||||
{}
|
||||
|
||||
SharedResourceGroup(
|
||||
const std::string& lockName, ResourceType&& initialRsrc)
|
||||
: lock(lockName), rsrc(std::move(initialRsrc))
|
||||
{}
|
||||
|
||||
~SharedResourceGroup() = default;
|
||||
|
||||
LockType lock;
|
||||
|
||||
Reference in New Issue
Block a user