Skip to content

Commit bed4e1a

Browse files
committed
Add assignment operator.
1 parent bd740c9 commit bed4e1a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Context.hpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ namespace kanzi
3535
{
3636
public:
3737
Context() {};
38-
Context(Context& ctx);
38+
Context(const Context& ctx);
39+
Context& operator=(const Context& ctx);
3940
virtual ~Context() {};
4041

4142
bool has(const std::string& key);
@@ -52,10 +53,17 @@ namespace kanzi
5253
};
5354

5455

55-
inline Context::Context(Context& ctx)
56+
inline Context::Context(const Context& ctx)
5657
: _map(ctx._map)
5758
{
5859
}
60+
61+
62+
inline Context& Context::operator=(const Context& ctx)
63+
{
64+
_map = ctx._map;
65+
return*this;
66+
}
5967

6068

6169
inline bool Context::has(const std::string& key)

0 commit comments

Comments
 (0)