(注意してください --- 私は実際には C++ プログラマーではなく、Java で C++ コードを再実装する必要があることに気づきました。)
JOpenFST で OpenFST バイナリ ファイルを読み取れるようにする取り組みの一環として、OpenFSTの次の関数を理解しようとしています。
template <class T,
typename std::enable_if<std::is_class<T>::value, T>::type* = nullptr>
inline std::istream &ReadType(std::istream &strm, T *t) {
return t->Read(strm);
}
Read
このテンプレート宣言でonの存在が保証されているものを特定できませんt
。私は自分の理解enable_if
とis_class
あいまいさを理解していますが、そのような方法を提供できるものが何であるかわかりません。
おそらくそれはより広い文脈から来ているのでしょうか?Read
すべてのクラス型に対してa を宣言する何か??? util.h
その関数が存在するインポートは次のとおりです。
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <fst/compat.h>
#include <fst/types.h>
#include <fst/log.h>
#include <fstream>
#include <fst/flags.h>
#include <unordered_map>
混乱している Java 開発者をお待ちいただきありがとうございます。