C++
ifstream ifs(txtPath.c_str(), ios::in | ios::binary); istreambuf_iterator<char> itr(ifs); string txt(itr, istreambuf_iterator<char>()); Visual C++ 2005で確認した。</char></char>
template <class T> struct example { typedef int a_type; example<T>::a_type func(); // <-- NG! void func(example<T>::a_type p); // <-- OK! };NGの方は頭にtypenameを付ければ良いのだけど、仮引数の方はtypenameを付けなくても大丈夫なのは何故だろう?</t></t></class>
サンプルコード。試した環境は MacOSX10.5 & Xcode3.0。エラー処理等には対処していない。 #include <iostream> #include <tiffio.h> extern "C" { #include <jpeglib.h> } using namespace std; int main (int argc, char * const argv[]) { ////// Jpegを読み出す struct jpeg_decompress_</jpeglib.h></tiffio.h></iostream>…
ってなコードがあって、それが激おそ。 なのでもっと速くなるように改造中。 すらばしい(←何故か変換できない)成果があった。
const_iteratorっちうのを初めて知った。 世界は広い。私の知識は狭い。