- template<typename T> T probe(Key key, T& eg)
- { return eg = map(eg).count(key) ? map(eg)[key] : NULL; }
-};
+ StateInfo st;
+ map<T>()[Position().set(code, WHITE, &st).material_key()] = Ptr<T>(new Endgame<E>(WHITE));
+ map<T>()[Position().set(code, BLACK, &st).material_key()] = Ptr<T>(new Endgame<E>(BLACK));
+ }
+
+ template<typename T>
+ const EndgameBase<T>* probe(Key key) {
+ return map<T>().count(key) ? map<T>()[key].get() : nullptr;
+ }
+}