How to copy ke::HashMap?
Since ke::HashMap has an implicitly deleted copy constructor and copy assignment operator, do I have to iterate over the map to copy it, or is there an easier way? And if the map is a member of another object, I guess I would have to write a copy constructor / assignment operator for that object and copy the map there?
|
Re: How to copy ke::HashMap?
Whoops, didn't see this before. It does appear you will have to copy it yourself. If you're willing, see if dvander will take a patch to implement them.
|
Re: How to copy ke::HashMap?
Thanks! Copy constructors were omitted from AMTL by design, but there's a PR for move constructors which would probably solve my issues. Unfortunately it has errors.
The issue I have with writing my own copy constructor is that its parameter is const, but ke::HashMap doesn't have a const iterator: PHP Code:
|
Re: How to copy ke::HashMap?
If you file some issues I can make sure the move-ctor bug is fixed, as well as the const iterator.
I've been thinking about lifting the copy-constructor restriction in AMTL. It'd require an opt-in parameter: Code:
ke::Vector v2(v1, ke::ExplicitCopy()); |
All times are GMT -4. The time now is 22:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.