Skip to content

Commit

Permalink
fix: Use of CachedEnforcer throws error from clang (#153)
Browse files Browse the repository at this point in the history
- add <string> to casbin_types.h for visibility of std::hash<string> of CachedEnforcer's unordered_map
 - add default virtual destructor

clang
	/include/c++/4.2.1
	Apple clang version 12.0.5 (clang-1205.0.22.11)
	Target: x86_64-apple-darwin20.2.0

Signed-off-by: William Michaels <bill@polarity.io>
  • Loading branch information
PolBreachIty authored Sep 23, 2021
1 parent 97b620e commit d939e45
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions casbin/enforcer_cached.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ class CachedEnforcer : public Enforcer {
*/
CachedEnforcer(const std::string& model_path, const std::string& policy_file, bool enable_log);

virtual ~CachedEnforcer() = default;

bool Enforce(Scope scope);

// Enforce with a vector param,decides whether a "subject" can access a
Expand Down
1 change: 1 addition & 0 deletions include/casbin/casbin_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#ifndef CASBIN_CPP_CASBIN_TYPES_H
#define CASBIN_CPP_CASBIN_TYPES_H

#include <string>
#include <variant>
#include <vector>
#include <initializer_list>
Expand Down

0 comments on commit d939e45

Please sign in to comment.