Task Description: Implement an ART (Adaptive Radix Tree) in C++
You are required to implement an Adaptive Radix Tree (ART) that can handle the following functionalities as outlined by the provided test cases. Your implementation should be placed in the /app/ directory, and the main functionalities needed are:
Insert Method: Implement a method insert(const std::string& key, uintptr_t value) that inserts a key-value pair into the ART. The method should ensure that if a key already exists in the tree, it returns without adding a duplicate entry.
Search Method: Implement a method search(const std::string& key) -> uintptr_t* which retrieves the value associated with a given key. If the key does not exist, it should return a nullptr.
Erase Method: Implement a method erase(const std::string& key) -> bool that removes a key-value pair from the ART. It should return true if the key was successfully removed and false if it was not found.
Size Method: Implement a method size() -> size_t that returns the current number of key-value pairs in the tree.
Minimum and Maximum Methods: Implement methods minimum() -> const Node* and maximum() -> const Node*, which return the nodes with the smallest and largest keys respectively.
Iterate Method: Implement a method iter(std::function<int(const std::string&, uintptr_t&)>) that iterates over all key-value pairs in the tree and applies the provided function to each pair.
Prefix Iteration: Implement a method iterPrefix(const unsigned char* prefix, size_t prefixLen, std::function<int(const std::string&, T&)>) that iterates over all keys that begin with a specified prefix and applies the provided function to each matching key.
Test Case Compatibility: Ensure that your implementation passes all provided test cases, which include functionality for handling various string inputs, searching, inserting, deleting, and iterating within the tree structure.
Make sure to handle edge cases, including empty strings and very long keys, as demonstrated in the test cases. Follow robust coding practices and ensure the implementation is efficient and well-structured.