私は次の行に沿ったクラスを持っています:
class ArraySim{
  public: 
     DataStructure* ds;
     ArraySim(bool which){
        if(true)
           ds = new STDMap();
        else 
           ds = new HashMap();
     }
     value_type& operator[](int idx){
          return ds->getValAtIndex(idx);
     }
     //define a  custom iterator type that can be used to iterate over both std::map and boost::unordered //map keys.
} 
class DataStructure{
    vitrual value_type& getValAtIndex(int idx)=0;
};
class STDMap: public DataStructure{
   //Class that wraps a std::map object and implements the virtual method to return the value against a //particular index(key)
};
class HashMap: publlic DataStructure{
    //Class that wraps a boost::unordered_map object and implements the virtual method to return the value //against a particular index(key)
} 
私が経験したのは、 Generic IteratorとTransform Iteratorです。私が理解しているように、変換反復子では、テンプレート引数で基になるコンテナー反復子を指定する必要があります。変換イテレータを使用して、マップ キーの周りにカスタム イテレータ タイプを定義し、同時にさまざまなタイプのマップ コンテナで機能させる方法はありますか?