« 末尾最適化の本 | Main | がちでC++のプロジェクトを立ち上げることになったら・・ »

2007.08.20

STLFilt

STLFilt使ったよ。
C++ Templateのエラーを見やすくするツールです。

比較用のoperatorを定義しないまま、vectorに乗せてstd::sort()してみる。
cygwinだとこんな感じ


d:\home\study\acc_verilog\acc_verilog\test\verilog_cv>g++ -c -I/usr/include/boost-1_33_1 verilog_cv_parse_tb.cpp
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_algo.h: In function `void std::partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator > >]':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_algo.h:2470: instantiated from `void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator > >, _Size = int]'
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_algo.h:2553: instantiated from `void std::sort(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator > >]'
verilog_cv_parse_tb.cpp:118: instantiated from here
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_algo.h:2274: error: no match for 'operator<' in '(&__i)->__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = acc::port*, _Container = std::vector >]() < (&__first)->__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = acc::port*, _Container = std::vector >]()'
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_algo.h: In function `const _Tp& std::__median(const _Tp&, const _Tp&, const _Tp&) [with _Tp = acc::port]':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_algo.h:2482: instantiated from `void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator > >, _Size = int]'
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_algo.h:2553: instantiated from `void std::sort(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator > >]'
verilog_cv_parse_tb.cpp:118: instantiated from here
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_algo.h:90: error: no match for 'operator<' in '__a < __b'
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_algo.h:91: error: no match for 'operator<' in '__b < __c'
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_algo.h:93: error: no match for 'operator<' in '__a < __c'
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_algo.h:97: error: no match for 'operator<' in '__a < __c'
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_algo.h:99: error: no match for 'operator<' in '__b < __c'
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_algo.h: In function `_RandomAccessIterator std::__unguarded_partition(_RandomAccessIterator, _RandomAccessIterator, _Tp) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator > >, _Tp = acc::port]':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_algo.h:2482: instantiated from `void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator > >, _Size = int]'
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_algo.h:2553: instantiated from `void std::sort(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator > >]'
verilog_cv_parse_tb.cpp:118: instantiated from here

STLFiltを通すと、こんな感じ


d:\home\study\acc_verilog\acc_verilog\test\verilog_cv>g++ -c -I/usr/include/boost-1_33_1 verilog_cv_parse_tb.cpp
stl_algo.h:2274: error: no match for 'operator<' in '(&__i)->iter::operator *() < (&__first)->iter::operator *()'
stl_algo.h: In function `void partial_sort(iter, iter, iter)':
verilog_cv_parse_tb.cpp:118: instantiated from here
stl_algo.h:2470: instantiated from `void __introsort_loop(iter, iter, int)'
stl_algo.h:2553: instantiated from `void sort(iter, iter)'
verilog_cv_parse_tb.cpp:118: instantiated from here


stl_algo.h:90: error: no match for 'operator<' in '__a < __b'
stl_algo.h: In function
`const acc::port & __median(
const acc::port &, const acc::port &, const acc::port &
)':
verilog_cv_parse_tb.cpp:118: instantiated from here
stl_algo.h:2482: instantiated from `void __introsort_loop(iter, iter, int)'
stl_algo.h:2553: instantiated from `void sort(iter, iter)'
verilog_cv_parse_tb.cpp:118: instantiated from here

stl_algo.h:91: error: no match for 'operator<' in '__b < __c'
stl_algo.h:93: error: no match for 'operator<' in '__a < __c'
stl_algo.h:97: error: no match for 'operator<' in '__a < __c'
stl_algo.h:99: error: no match for 'operator<' in '__b < __c'

ちょっと見やすくなる。

|

« 末尾最適化の本 | Main | がちでC++のプロジェクトを立ち上げることになったら・・ »

Comments

Post a comment



(Not displayed with comment.)




TrackBack

TrackBack URL for this entry:
http://app.cocolog-nifty.com/t/trackback/18154/16174949

Listed below are links to weblogs that reference STLFilt:

« 末尾最適化の本 | Main | がちでC++のプロジェクトを立ち上げることになったら・・ »