diff --git a/casbin/model/policy_collection.cpp b/casbin/model/policy_collection.cpp index 6f422e83..705e119e 100644 --- a/casbin/model/policy_collection.cpp +++ b/casbin/model/policy_collection.cpp @@ -17,6 +17,9 @@ #include "casbin/model/policy_collection.hpp" #include +PoliciesValues::PoliciesValues() + : opt_base_vector(std::initializer_list{}), opt_base_hashset({}) {} + PoliciesValues::PoliciesValues(PoliciesVector&& base_collection) : opt_base_vector(base_collection), opt_base_hashset({}) {} diff --git a/include/casbin/model/policy_collection.hpp b/include/casbin/model/policy_collection.hpp index 14050a6b..4762e2e7 100644 --- a/include/casbin/model/policy_collection.hpp +++ b/include/casbin/model/policy_collection.hpp @@ -45,7 +45,8 @@ using PoliciesHashset = std::unordered_set; PoliciesValues(PoliciesVector&& base_collection); PoliciesValues(PoliciesHashset&& base_collection); public: - PoliciesValues(const std::initializer_list& list={}); + PoliciesValues(); + PoliciesValues(const std::initializer_list& list); PoliciesValues(size_t capacity); static PoliciesValues createWithVector(const std::initializer_list& list={}); static PoliciesValues createWithHashset(const std::initializer_list& list={});