Skip to content

Commit

Permalink
default constructor definition to setup PoliciesValues proper way
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyChashchegorov committed Mar 17, 2024
1 parent 0e9ccb0 commit 963ff6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions casbin/model/policy_collection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
#include "casbin/model/policy_collection.hpp"

#include <iostream>
PoliciesValues::PoliciesValues()
: opt_base_vector(std::initializer_list<PolicyValues>{}), opt_base_hashset({}) {}

PoliciesValues::PoliciesValues(PoliciesVector&& base_collection)
: opt_base_vector(base_collection), opt_base_hashset({}) {}

Expand Down
3 changes: 2 additions & 1 deletion include/casbin/model/policy_collection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ using PoliciesHashset = std::unordered_set<PolicyValues>;
PoliciesValues(PoliciesVector&& base_collection);
PoliciesValues(PoliciesHashset&& base_collection);
public:
PoliciesValues(const std::initializer_list<PolicyValues>& list={});
PoliciesValues();
PoliciesValues(const std::initializer_list<PolicyValues>& list);
PoliciesValues(size_t capacity);
static PoliciesValues createWithVector(const std::initializer_list<PolicyValues>& list={});
static PoliciesValues createWithHashset(const std::initializer_list<PolicyValues>& list={});
Expand Down

0 comments on commit 963ff6e

Please sign in to comment.