Use std::swap instead of a custom version to avoid "ambiguous call" compile error with ADL.
For example, without this PR, the following code fails to compile with C++ 11:
std::unique_ptr<marisa::Trie> a;
// Here, `unique_ptr` calls `swap` internally using ADL.
// Previously, this failed to compile because of the conflict with `marisa::swap`:
a.reset(new marisa::Trie());
Use
std::swap
instead of a custom version to avoid "ambiguous call" compile error with ADL.For example, without this PR, the following code fails to compile with C++ 11:
PR https://github.com/s-yata/marisa-trie/pull/17 by @NOMORECOFFEE also tried to fix this but it didn't have a C++ 98 fallback and got closed by its author.